Skip to content

Commit 8264222

Browse files
committed
Merge branch 'master' of github.com:tomchristie/django-rest-framework
2 parents 086115c + 3666b3f commit 8264222

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

docs/api-guide/pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The pagination API can support either:
1515

1616
The built-in styles currently all use links included as part of the content of the response. This style is more accessible when using the browsable API.
1717

18-
Pagination is only performed automatically if you're using the generic views or viewsets. If you're using a regular `APIView`, you'll need to call into the pagination API yourself to ensure you return a paginated response. See the source code for the `mixins.ListMixin` and `generics.GenericAPIView` classes for an example.
18+
Pagination is only performed automatically if you're using the generic views or viewsets. If you're using a regular `APIView`, you'll need to call into the pagination API yourself to ensure you return a paginated response. See the source code for the `mixins.ListModelMixin` and `generics.GenericAPIView` classes for an example.
1919

2020
## Setting the pagination style
2121

rest_framework/filters.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,16 @@ def construct_search(self, field_name):
102102
def filter_queryset(self, request, queryset, view):
103103
search_fields = getattr(view, 'search_fields', None)
104104

105-
orm_lookups = [
106-
self.construct_search(six.text_type(search_field))
107-
for search_field in search_fields
108-
]
109105
search_terms = self.get_search_terms(request)
110106

111107
if not search_fields or not search_terms:
112108
return queryset
113109

110+
orm_lookups = [
111+
self.construct_search(six.text_type(search_field))
112+
for search_field in search_fields
113+
]
114+
114115
base = queryset
115116
for search_term in search_terms:
116117
queries = [

0 commit comments

Comments
 (0)