api: allow setting of page size

This commit is contained in:
Jens Langhammer 2020-12-01 11:58:14 +01:00
parent 93bf977709
commit 93bfe60369
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,8 @@ from rest_framework.response import Response
class Pagination(pagination.PageNumberPagination): class Pagination(pagination.PageNumberPagination):
"""Pagination which includes total pages and current page""" """Pagination which includes total pages and current page"""
page_size_query_param = "page_size"
def get_paginated_response(self, data): def get_paginated_response(self, data):
previous_page_number = 0 previous_page_number = 0
if self.page.has_previous(): if self.page.has_previous():