This commit is contained in:
Rikuoja 2015-08-24 17:02:49 +03:00
parent 0198bce34f
commit 65df9fd5c6

View File

@ -102,15 +102,16 @@ class SearchFilter(BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
search_fields = getattr(view, 'search_fields', None)
orm_lookups = [
self.construct_search(six.text_type(search_field))
for search_field in search_fields
]
search_terms = self.get_search_terms(request)
if not search_fields or not search_terms:
return queryset
orm_lookups = [
self.construct_search(six.text_type(search_field))
for search_field in search_fields
]
base = queryset
for search_term in search_terms:
queries = [