aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorCarlton Gibson2015-02-10 10:51:38 +0100
committerCarlton Gibson2015-02-10 10:51:38 +0100
commit3522b69394d932c8bf8028a456b6d9b64c38b54e (patch)
tree4c9f41e95aefb0de3d567949351ae4113f2b2961 /rest_framework
parentd87bb67d11918683425af1c1d56c0c57f50e81b3 (diff)
downloaddjango-rest-framework-3522b69394d932c8bf8028a456b6d9b64c38b54e.tar.bz2
Add `distinct` call in `filter_queryset`
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/filters.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/filters.py b/rest_framework/filters.py
index d188a2d1..d3f55a44 100644
--- a/rest_framework/filters.py
+++ b/rest_framework/filters.py
@@ -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