Skip to content

ReleaseNoteFilterSet

Overview

Points a filter declared against a related model's formatted_name at the column behind it.

A filter declares the path it queries as field_name, and django-filter builds its lookup straight from that (field_name + lookup_expr). customer__formatted_name names nothing the database knows on a model that reaches its formatted name through formatted_name_lookup_expression: the annotation VuedaViewSet.get_queryset adds belongs to the queryset being filtered, not to the tables it joins. So the declared path is rewritten to the one behind it — customer__data__formatted_name — on this filterset's own copy of the filters.

The class-level declaration is untouched, and so is everything client-facing. The query parameter a client sends is the filter's name on the filterset, not its field_name, and the label a filter generates for itself is taken from the declared path before the rewrite, so model_filtering metadata describes the filter the way it was written.

Meta

Source

server/vueda/release/filtersets.py:10

_meta

base_filters

declared_filters

Source

server/vueda/release/filtersets.py:9

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2