mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 17:39:48 +03:00
Replace filterset_fields with filter_fields
Was trying to use DjangoFilterBackend and it was not working until I made this change in my code
This commit is contained in:
parent
9ac9c1b2ea
commit
f6a90ed13b
|
@ -166,7 +166,7 @@ If all you need is simple equality-based filtering, you can set a `filterset_fie
|
|||
queryset = Product.objects.all()
|
||||
serializer_class = ProductSerializer
|
||||
filter_backends = (DjangoFilterBackend,)
|
||||
filterset_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:
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user