Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
03818ed0
Commit
03818ed0
authored
Feb 26, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pagination tweaks and docs
parent
44d42221
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
docs/api-guide/pagination.md
+0
-0
rest_framework/pagination.py
+3
-3
No files found.
docs/api-guide/pagination.md
View file @
03818ed0
This diff is collapsed.
Click to expand it.
rest_framework/pagination.py
View file @
03818ed0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment