Skip to content

Commit

Permalink
fix: api_rest pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 5, 2024
1 parent 21ade64 commit 5a256eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions uniticket/api_rest/pagination.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions uniticket/uni_ticket_project/settingslocal.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a256eb

Please sign in to comment.