Corp/backend/api/pagination.py

15 lines
592 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Кастомные классы пагинации для API."""
from rest_framework.pagination import PageNumberPagination
class StandardPagination(PageNumberPagination):
"""Стандартная пагинация с поддержкой параметра page_size.
Позволяет клиенту указывать размер страницы через параметр page_size,
с ограничением максимального размера страницы.
"""
page_size = 20
page_size_query_param = "page_size"
max_page_size = 200