Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Re-add ability to customize paginator class #3684

Closed
@jezdez

Description

@jezdez

As part of the 3.1 release DRF lost the ability to override the paginator class and replaced it with a custom implementation that uses Django's default paginator in the criticalpaginate_queryset method. This change severely limits the architectural separation of data pagination from view level pagination behavior.

E.g. code that happens when the pagination page queryset is evaluated now needs to be handled in an overriddenPagination.paginate_queryset method. Since the instantiation of the paginator is in the middle of the defaultPageNumberPagination.paginate_queryset method working around this deprecation results in effectively completely rewriting it and making it a future tech debt concern. The alternative to run queryset evaluation time code inpaginate_queryset and then call the parentpaginate_queryset is equally not satisfactory as at that point the page object hasn't been created yet which contains vital information that is not available on the pagination instance. Fetching that data after the fact would again require evaluation the queryset, again not wanted.

As such the removal of the ability to override the paginator class is a step backwards that leads to brittle workarounds (monkeypatches) and removed the ability to hook into a key moment of pagination. Please advise what I can do to improve this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp