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
b8c8d10a
Commit
b8c8d10a
authored
Aug 29, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `page_size` argument.
`paginate_queryset` no longer takes an optional `page_size` argument.
parent
e5e6329a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
15 deletions
+1
-15
rest_framework/generics.py
+1
-15
No files found.
rest_framework/generics.py
View file @
b8c8d10a
...
...
@@ -111,23 +111,11 @@ class GenericAPIView(views.APIView):
context
=
self
.
get_serializer_context
()
return
pagination_serializer_class
(
instance
=
page
,
context
=
context
)
def
paginate_queryset
(
self
,
queryset
,
page_size
=
None
):
def
paginate_queryset
(
self
,
queryset
):
"""
Paginate a queryset if required, either returning a page object,
or `None` if pagination is not configured for this view.
"""
deprecated_style
=
False
if
page_size
is
not
None
:
warnings
.
warn
(
'The `page_size` parameter to `paginate_queryset()` '
'is deprecated. '
'Note that the return style of this method is also '
'changed, and will simply return a page object '
'when called without a `page_size` argument.'
,
DeprecationWarning
,
stacklevel
=
2
)
deprecated_style
=
True
else
:
# Determine the required page size.
# If pagination is not configured, simply return None.
page_size
=
self
.
get_paginate_by
()
if
not
page_size
:
return
None
...
...
@@ -152,8 +140,6 @@ class GenericAPIView(views.APIView):
'message'
:
str
(
exc
)
})
if
deprecated_style
:
return
(
paginator
,
page
,
page
.
object_list
,
page
.
has_other_pages
())
return
page
def
filter_queryset
(
self
,
queryset
):
...
...
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