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

Feature request: configuration file setting for MAX_PAGE_SIZE #6185

Closed
@lcary

Description

@lcary

Checklist

  • I have verified that that issue exists against themaster branch of Django REST framework.
  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • This is not a usage question. (Those should be directed to thediscussion group instead.)
  • This cannot be dealt with as a third party library. (We prefer new functionality to bein the form of third party libraries where possible.)
  • I have reduced the issue to the simplest possible case.
  • I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

Details

This issue is intended to discuss adding aMAX_PAGE_SIZE pagination setting to theREST_FRAMEWORK settings.

The default page size for paginated results can be configured by settingPAGE_SIZE in theREST_FRAMEWORK section of the Django settings file. However, there is no setting to configure the maximum page size from the Django settings file. The django-rest-framework could benefit from having aMAX_PAGE_SIZE setting as well:

REST_FRAMEWORK = {    'PAGE_SIZE': 10,    'MAX_PAGE_SIZE': 1000,    ...}

Downstream issue: Thedjango-rest-framework-json-api library by default sets the maximum page size to a value of 100, which can be overridden by aJsonApiPageNumberPagination class. Using a class to configure the maximum page size, and using the Django configuration file to change the default page size is unnecessarily inconsistent. It would be preferable to be able to configure both settings in one place and to have this setting supported by the django-rest-framework library and not a dependent library.

Please let me know what you think about this feature request. I'm open to alternative solutions, and also open to submitting a pull request that modifiesthe relevant lines of the pagination module and adds documentation for the new django-rest-framework setting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp