Skip to content

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

get_filterset_class(
    view, queryset=None
) -> type[FilterSet] | None

Return the FilterSet class for the view, preferring view.get_filterset_class() over view.filterset_class when defined.

get_filterset

get_filterset(request, queryset, view) -> FilterSet | None

Build the FilterSet instance for the current request, calling view.get_filterset(filterset_class) when the view defines that hook.

filter_queryset

filter_queryset(request, queryset, view)

Apply the resolved FilterSet to queryset and return the filtered result. No-op when the view has no FilterSet.

get_schema_operation_parameters

get_schema_operation_parameters(
    view,
) -> list[dict[str, Any]]

Schema parameter generation is delegated to restflow.spectacular.parameters.build_filterset_parameters.