Improve PageNumberPagination docs by adding page_query_param customization example#9904
Open
kosbemrunal wants to merge 4 commits intoencode:mainfrom
Open
Improve PageNumberPagination docs by adding page_query_param customization example#9904kosbemrunal wants to merge 4 commits intoencode:mainfrom
kosbemrunal wants to merge 4 commits intoencode:mainfrom
Conversation
rest_framework/templates/rest_framework/pagination/previous_and_next.html
Show resolved
Hide resolved
auvipy
approved these changes
Feb 28, 2026
There was a problem hiding this comment.
Pull request overview
Adds a brief documentation example showing how to customize PageNumberPagination.page_query_param so clients can use a non-default page query parameter.
Changes:
- Document the default
pagequery parameter forPageNumberPagination. - Add an example subclass overriding
page_query_param(e.g.,?p=2).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| On `GenericAPIView` subclasses you may also set the `pagination_class` attribute to select `PageNumberPagination` on a per-view basis. | ||
|
|
||
| By default, the query parameter name used for pagination is `page`. |
There was a problem hiding this comment.
Line ends with two trailing spaces, which forces a Markdown hard line break. Unless a hard break is intended here, remove the trailing whitespace to keep formatting consistent and avoid whitespace-lint noise.
Suggested change
| By default, the query parameter name used for pagination is `page`. | |
| By default, the query parameter name used for pagination is `page`. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a short example demonstrating how to customize
the
page_query_paramattribute inPageNumberPagination.This clarifies how users can override the default
pagequery parameter when implementing custom pagination classes..