mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 17:39:48 +03:00
Incorrect property name makes example not work
Under heading `Overriding the initial queryset` the filter class is overridden which is documented as done by setting `filterset_class`. However under django_filters/rest_framework/backends.py in class `DjangoFilterBackend`, the method `get_filter_class` will use attribute `filter_class` instead. As a result, when trusting the documentation no filtering will take place at all.
This commit is contained in:
parent
1e519486e1
commit
4dafbb1dc0
|
@ -127,7 +127,7 @@ Note that you can use both an overridden `.get_queryset()` and generic filtering
|
||||||
"""
|
"""
|
||||||
model = Product
|
model = Product
|
||||||
serializer_class = ProductSerializer
|
serializer_class = ProductSerializer
|
||||||
filterset_class = ProductFilter
|
filter_class = ProductFilter
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
user = self.request.user
|
user = self.request.user
|
||||||
|
|
Loading…
Reference in New Issue
Block a user