Skip to content

Improve PageNumberPagination docs by adding page_query_param customization example#9904

Open
kosbemrunal wants to merge 4 commits intoencode:mainfrom
kosbemrunal:improve-pagination-docs
Open

Improve PageNumberPagination docs by adding page_query_param customization example#9904
kosbemrunal wants to merge 4 commits intoencode:mainfrom
kosbemrunal:improve-pagination-docs

Conversation

@kosbemrunal
Copy link

This PR adds a short example demonstrating how to customize
the page_query_param attribute in PageNumberPagination.

This clarifies how users can override the default page
query parameter when implementing custom pagination classes..

@auvipy auvipy self-requested a review February 28, 2026 04:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 page query parameter for PageNumberPagination.
  • 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`.
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants