mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Add distinct
call in filter_queryset
This commit is contained in:
parent
d87bb67d11
commit
3522b69394
|
@ -104,7 +104,7 @@ class SearchFilter(BaseFilterBackend):
|
|||
for search_term in self.get_search_terms(request):
|
||||
or_queries = [models.Q(**{orm_lookup: search_term})
|
||||
for orm_lookup in orm_lookups]
|
||||
queryset = queryset.filter(reduce(operator.or_, or_queries))
|
||||
queryset = queryset.filter(reduce(operator.or_, or_queries)).distinct()
|
||||
|
||||
return queryset
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user