mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Merge pull request #2700 from tomchristie/do-not-paginate-if-page-size-none
Do not paginate if PAGE_SIZE=None
This commit is contained in:
commit
2148f32007
|
@ -388,6 +388,9 @@ class LimitOffsetPagination(BasePagination):
|
|||
|
||||
def paginate_queryset(self, queryset, request, view=None):
|
||||
self.limit = self.get_limit(request)
|
||||
if self.limit is None:
|
||||
return None
|
||||
|
||||
self.offset = self.get_offset(request)
|
||||
self.count = _get_count(queryset)
|
||||
self.request = request
|
||||
|
@ -491,6 +494,9 @@ class CursorPagination(BasePagination):
|
|||
template = 'rest_framework/pagination/previous_and_next.html'
|
||||
|
||||
def paginate_queryset(self, queryset, request, view=None):
|
||||
if self.page_size is None:
|
||||
return None
|
||||
|
||||
self.base_url = request.build_absolute_uri()
|
||||
self.ordering = self.get_ordering(request, queryset, view)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user