You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
346 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

from rest_framework.pagination import PageNumberPagination
class GlobalPagination(PageNumberPagination):
"""
list/?page=4&size=20
"""
page_size = 10 # 默认每页数目
page_size_query_param = 'size' # 前端发送的每页数目关键字名默认为None
max_page_size = 100 # 前端最多能设置的每页数量