1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Make max page size tunable

This commit is contained in:
Matthew Jones 2016-12-12 12:10:33 -05:00
parent 08edbb1b72
commit 349d497bb4
2 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@
# All Rights Reserved.
# Django REST Framework
from django.conf import settings
from rest_framework import pagination
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):
page_size_query_param = 'page_size'
max_page_size = 200
max_page_size = settings.MAX_PAGE_SIZE
def get_next_link(self):
if not self.page.has_next():

View File

@ -223,6 +223,7 @@ INSTALLED_APPS = (
INTERNAL_IPS = ('127.0.0.1',)
MAX_PAGE_SIZE = 200
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'awx.api.pagination.Pagination',
'PAGE_SIZE': 25,