mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
outdated method 'get_filter_backends' has been deleted from the documentation
This commit is contained in:
parent
bde05bfd3e
commit
4a2bad03c5
|
@ -124,22 +124,6 @@ For example:
|
|||
|
||||
Note that if your API doesn't include any object level permissions, you may optionally exclude the `self.check_object_permissions`, and simply return the object from the `get_object_or_404` lookup.
|
||||
|
||||
#### `get_filter_backends(self)`
|
||||
|
||||
Returns the classes that should be used to filter the queryset. Defaults to returning the `filter_backends` attribute.
|
||||
|
||||
May be overridden to provide more complex behavior with filters, such as using different (or even exclusive) lists of filter_backends depending on different criteria.
|
||||
|
||||
For example:
|
||||
|
||||
def get_filter_backends(self):
|
||||
if "geo_route" in self.request.query_params:
|
||||
return (GeoRouteFilter, CategoryFilter)
|
||||
elif "geo_point" in self.request.query_params:
|
||||
return (GeoPointFilter, CategoryFilter)
|
||||
|
||||
return (CategoryFilter,)
|
||||
|
||||
#### `get_serializer_class(self)`
|
||||
|
||||
Returns the class that should be used for the serializer. Defaults to returning the `serializer_class` attribute.
|
||||
|
|
Loading…
Reference in New Issue
Block a user