aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorTom Christie2015-02-26 12:48:34 +0000
committerTom Christie2015-02-26 12:48:34 +0000
commit03818ed004cbe77459663f92a21691cfb7d9f010 (patch)
tree5a88cc58d555659d89e4f81efa4bbccd4cf30d7b /rest_framework
parent44d42221ca40ae23072d950490bf2cfc898c932e (diff)
downloaddjango-rest-framework-03818ed004cbe77459663f92a21691cfb7d9f010.tar.bz2
Pagination tweaks and docs
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/pagination.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py
index 496500ba..80985873 100644
--- a/rest_framework/pagination.py
+++ b/rest_framework/pagination.py
@@ -259,7 +259,7 @@ class PageNumberPagination(BasePagination):
)
raise NotFound(msg)
- if paginator.count > 1:
+ if paginator.count > 1 and self.template is not None:
# The browsable API should display pagination controls.
self.display_page_controls = True
@@ -347,7 +347,7 @@ class LimitOffsetPagination(BasePagination):
self.offset = self.get_offset(request)
self.count = _get_count(queryset)
self.request = request
- if self.count > self.limit:
+ if self.count > self.limit and self.template is not None:
self.display_page_controls = True
return queryset[self.offset:self.offset + self.limit]
@@ -518,7 +518,7 @@ class CursorPagination(BasePagination):
# Display page controls in the browsable API if there is more
# than one page.
- if self.has_previous or self.has_next:
+ if (self.has_previous or self.has_next) and self.template is not None:
self.display_page_controls = True
return self.page