diff --git a/uniticket/api_rest/pagination.py b/uniticket/api_rest/pagination.py new file mode 100644 index 0000000..58d9b68 --- /dev/null +++ b/uniticket/api_rest/pagination.py @@ -0,0 +1,7 @@ +from rest_framework.pagination import PageNumberPagination + + +class StandardPagination(PageNumberPagination): + # page_size = 10 + page_size_query_param = 'page_size' + max_page_size = 1000 diff --git a/uniticket/uni_ticket_project/settingslocal.py.example b/uniticket/uni_ticket_project/settingslocal.py.example index 8795bf0..8a3d345 100644 --- a/uniticket/uni_ticket_project/settingslocal.py.example +++ b/uniticket/uni_ticket_project/settingslocal.py.example @@ -236,8 +236,8 @@ REST_FRAMEWORK = { 'rest_framework.permissions.IsAuthenticated' ], 'DEFAULT_PAGINATION_CLASS': - 'rest_framework.pagination.LimitOffsetPagination', - 'PAGE_SIZE': 100 + 'api_rest.pagination.StandardPagination' + 'PAGE_SIZE': 10 } # chat: message to load in a conversation from history