Skip to content
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

pagination consistency #1091

Closed
davidism opened this issue Sep 18, 2022 · 1 comment · Fixed by #1094
Closed

pagination consistency #1091

davidism opened this issue Sep 18, 2022 · 1 comment · Fixed by #1094
Assignees
Milestone

Comments

@davidism
Copy link
Member

Pagination has a few defaults that we might want to adjust, and 3.0 is the time to do it.

  • per_page can be 0. I'm not sure why this is allowed. page cannot be 0, that causes a 404 error.
  • max_per_page should have a default, maybe 100, so projects don't need to remember to add one to prevent users passing very high values.
  • pages is currently 0 instead of None if total is None. If the total is 0, 0 pages makes sense, but if the total wasn't calculated it doesn't mean there are 0 pages it just means we don't know the number.
@davidism davidism added this to the 3.0 milestone Sep 18, 2022
@davidism davidism self-assigned this Sep 18, 2022
@davidism
Copy link
Member Author

Decided not to change pages if total is None. It keeps the type simple (int), and would require the same amount of user code to check if page.total is None instead of if page.pages is None.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant