Skip to content

Add sensors to filters and add other missing filters#53

Merged
gosku merged 2 commits into
mainfrom
fix-add-missing-filters
May 31, 2026
Merged

Add sensors to filters and add other missing filters#53
gosku merged 2 commits into
mainfrom
fix-add-missing-filters

Conversation

@gosku

@gosku gosku commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add missing numeric filters (highlight, shadow, color, sharpness, high_iso_nr, clarity) to the recipes explorer sidebar. These were stored as DecimalField in the DB but missing from RECIPE_FILTER_FIELDS; a fix to the is_numeric check ensures correct null exclusion and numeric sort order for decimal values.
  • Add a sensor filter to both the recipes explorer and images gallery sidebars. Sensors are a M2M relation and required special-casing: faceted counts use distinct=True, and the gallery filter applies the M2M lookup via a pk-subquery to avoid corrupting the Count("images") annotation. Recipes with no sensor assigned show as "Not assigned" (URL value: none).
  • Sensor filter appears immediately below Film Simulation in both sidebars.

Notes

  • RECIPE_FILTER_FIELDS was intentionally left unchanged — sensors are handled as a special case in the filter functions rather than as a simple field lookup.
  • Both view helpers (_active_filters_from_request, _recipe_explorer_filters_from_request) were updated to read sensors from the request, since it is not covered by the RECIPE_FILTER_FIELDS loop.
  • The sidebar templates now use {{ option.label|default:option.value }} to allow a display label that differs from the URL parameter value.

gosku and others added 2 commits May 31, 2026 09:35
…ers to recipes explorer sidebar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gosku gosku force-pushed the fix-add-missing-filters branch from ac6c524 to 62aba7e Compare May 31, 2026 10:08
@gosku gosku merged commit fbd8546 into main May 31, 2026
4 checks passed
@gosku gosku deleted the fix-add-missing-filters branch May 31, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant