mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
Make max page size tunable
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
|
|
||||||
# Django REST Framework
|
# Django REST Framework
|
||||||
|
from django.conf import settings
|
||||||
from rest_framework import pagination
|
from rest_framework import pagination
|
||||||
from rest_framework.utils.urls import replace_query_param
|
from rest_framework.utils.urls import replace_query_param
|
||||||
|
|
||||||
@@ -9,7 +10,7 @@ from rest_framework.utils.urls import replace_query_param
|
|||||||
class Pagination(pagination.PageNumberPagination):
|
class Pagination(pagination.PageNumberPagination):
|
||||||
|
|
||||||
page_size_query_param = 'page_size'
|
page_size_query_param = 'page_size'
|
||||||
max_page_size = 200
|
max_page_size = settings.MAX_PAGE_SIZE
|
||||||
|
|
||||||
def get_next_link(self):
|
def get_next_link(self):
|
||||||
if not self.page.has_next():
|
if not self.page.has_next():
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ INSTALLED_APPS = (
|
|||||||
|
|
||||||
INTERNAL_IPS = ('127.0.0.1',)
|
INTERNAL_IPS = ('127.0.0.1',)
|
||||||
|
|
||||||
|
MAX_PAGE_SIZE = 200
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
'DEFAULT_PAGINATION_CLASS': 'awx.api.pagination.Pagination',
|
'DEFAULT_PAGINATION_CLASS': 'awx.api.pagination.Pagination',
|
||||||
'PAGE_SIZE': 25,
|
'PAGE_SIZE': 25,
|
||||||
|
|||||||
Reference in New Issue
Block a user