mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
Merge 4af51b402f
into baacdd821f
This commit is contained in:
commit
c3b31cc314
|
@ -102,7 +102,7 @@ If all you need is simple equality-based filtering, you can set a `filter_fields
|
||||||
class ProductList(generics.ListAPIView):
|
class ProductList(generics.ListAPIView):
|
||||||
model = Product
|
model = Product
|
||||||
serializer_class = ProductSerializer
|
serializer_class = ProductSerializer
|
||||||
filter_fields = ('category', 'in_stock')
|
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:
|
This will automatically create a `FilterSet` class for the given fields, and will allow you to make requests such as:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user