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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add `get_page_size` hook to `CursorPagination` #3147

merged 8 commits into from Jul 14, 2015


None yet
3 participants

tomchristie commented Jul 14, 2015

Allows developers to easily customize support for page_size parameters or any other page size behaviors.

The default behavior is left intentionally simple, on the basis that cursor paginations should tend to present their query parameters as opaque cursors, and should tend to have page sizes determined server side, rather than client side.

@tomchristie tomchristie added this to the 3.1.4 Release milestone Jul 14, 2015

tomchristie added a commit that referenced this pull request Jul 14, 2015

Merge pull request #3147 from tomchristie/uploadcare-cursor-limits
Add `get_page_size` hook to `CursorPagination`

@tomchristie tomchristie merged commit 9c952dc into master Jul 14, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@tomchristie tomchristie deleted the uploadcare-cursor-limits branch Jul 14, 2015


This comment has been minimized.


loic commented on 4683614 Jul 16, 2015

Haven't actually tried it because of the metadata AttributeError, but I suspect this won't work because page_size is also needed in get_previous_link() and get_next_link().

This comment has been minimized.


tomchristie replied Jul 16, 2015

Good point.
The statefulness on the pagination instances is necessary, but it is also a bit crufty. :-|


This comment has been minimized.


tomchristie commented Jul 16, 2015

Thanks for the pointer @loic. Resolved in c879aaf

@tomchristie tomchristie modified the milestones: 3.1.4 Release, 3.2.0 Release Jul 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment