Add support for page_size parameter in CursorPaginator class by cypreess · Pull Request #5250 · encode/django-rest-framework (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation4 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
CursorPaginator
receives identical support for page size query parameter as PageNumberPagination
.
Solving #5249
Hiya! The code looks good, but I'm still in two minds about if we should accept extra behavior on the already-complex cursor pagination. Not sure how to best take a judgement on this right now.
@tomchristie I actually don't understand where is that complexity you mention. In pagination you have two concepts:
- logic for finding page starting position - this can be anything, an offset, a cursor to value used for ordering, etc.
- logic for saying how many elements to retrieve from start position - here just a single integer param of
page_size
The only doubt I have here is about the role of offset_cutoff
in whole story.
I hope this can be merged in at some point, because we really like this feature at The Atlantic. Ignoring the extensive unit tests, it's only a little bit more code and makes the CursorPaginator
API work more like the other built in paginators.
carltongibson pushed a commit that referenced this pull request
Set version number for 3.7.0 release
Rename release notes section
Moved issue links to top for easier access. (Can move back later)
Strict JSON handling
Add release note for #5250
Add release notes for #5170
Add release notes for #5443
Add release notes for #5448
Add release notes for #5452
Add release not for #5342
Add release notes for 5454
Remove Django 1.8 & 1.9 from README and setup.py
- Release notes for merged 3.6.5 milestone tickets
Tickets migrated to 3.7.0 milestone.
Add release notes for #5469
Add release notes from AM 2ndOct
Add final changes to the release notes.
Add date and milestone link
Move issue links back to bottom.
Update translations from transifex
Begin releae anouncement
Add release note for #5482
3.7 release announcement & related docs.