From 325789db956b1df41bdf18b5689a44d628896ee5 Mon Sep 17 00:00:00 2001 From: Nico Mandery Date: Mon, 8 Jun 2015 15:18:30 +0200 Subject: [PATCH] set the filter_backends class variable in the DjangoFilterBackend documentation for clearness --- docs/api-guide/filtering.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md index cd0173419..c1311c35e 100644 --- a/docs/api-guide/filtering.md +++ b/docs/api-guide/filtering.md @@ -149,6 +149,7 @@ If all you need is simple equality-based filtering, you can set a `filter_fields class ProductList(generics.ListAPIView): queryset = Product.objects.all() serializer_class = ProductSerializer + filter_backends = (filters.DjangoFilterBackend,) filter_fields = ('category', 'in_stock') This will automatically create a `FilterSet` class for the given fields, and will allow you to make requests such as: @@ -174,6 +175,7 @@ For more advanced filtering requirements you can specify a `FilterSet` class tha class ProductList(generics.ListAPIView): queryset = Product.objects.all() serializer_class = ProductSerializer + filter_backends = (filters.DjangoFilterBackend,) filter_class = ProductFilter