mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Fix DjangoFilterBackend mro
This commit is contained in:
parent
53b100d03d
commit
01ffb8961d
|
@ -50,12 +50,17 @@ if django_filters:
|
||||||
DeprecationWarning
|
DeprecationWarning
|
||||||
)
|
)
|
||||||
return super(FilterSet, self).__init__(*args, **kwargs)
|
return super(FilterSet, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
DFBase = django_filters.rest_framework.DjangoFilterBackend
|
||||||
|
|
||||||
else:
|
else:
|
||||||
def FilterSet():
|
def FilterSet():
|
||||||
assert False, 'django-filter must be installed to use the `FilterSet` class'
|
assert False, 'django-filter must be installed to use the `FilterSet` class'
|
||||||
|
|
||||||
|
DFBase = BaseFilterBackend
|
||||||
|
|
||||||
class DjangoFilterBackend(BaseFilterBackend):
|
|
||||||
|
class DjangoFilterBackend(DFBase):
|
||||||
"""
|
"""
|
||||||
A filter backend that uses django-filter.
|
A filter backend that uses django-filter.
|
||||||
"""
|
"""
|
||||||
|
@ -69,9 +74,7 @@ class DjangoFilterBackend(BaseFilterBackend):
|
||||||
DeprecationWarning
|
DeprecationWarning
|
||||||
)
|
)
|
||||||
|
|
||||||
from django_filters.rest_framework import DjangoFilterBackend
|
return super(DjangoFilterBackend, cls).__new__(cls, *args, **kwargs)
|
||||||
|
|
||||||
return DjangoFilterBackend(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
class SearchFilter(BaseFilterBackend):
|
class SearchFilter(BaseFilterBackend):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user