RestflowFilterBackend¶
The DRF filter backend that plugs a FilterSet into a view and
emits OpenAPI parameters. See the
DRF Integration guide for
an overview and worked examples.
RestflowFilterBackend ¶
Bases: BaseFilterBackend
Plug a restflow FilterSet into DRF's filter backend pipeline.
Looks up view.filterset_class (or calls
view.get_filterset_class() if the view defines one) and uses it
to filter the queryset.
Example:
::
class ProductView(generics.ListAPIView):
queryset = Product.objects.all()
serializer_class = ProductSerializer
filter_backends = [RestflowFilterBackend]
filterset_class = ProductFilterSet
get_filterset_class ¶
Return the FilterSet class for the view, preferring view.get_filterset_class() over view.filterset_class when defined.
get_filterset ¶
Build the FilterSet instance for the current request, calling view.get_filterset(filterset_class) when the view defines that hook.
filter_queryset ¶
Apply the resolved FilterSet to queryset and return the filtered result. No-op when the view has no FilterSet.
get_schema_operation_parameters ¶
Schema parameter generation is delegated to restflow.spectacular.parameters.build_filterset_parameters.