mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
change classes hierarchy
This commit is contained in:
parent
bacc29fb96
commit
f899670afa
|
@ -201,7 +201,7 @@ class BasePagination(object):
|
||||||
raise NotImplementedError('to_html() must be implemented to display page controls.')
|
raise NotImplementedError('to_html() must be implemented to display page controls.')
|
||||||
|
|
||||||
|
|
||||||
class PageSizePaginationMixin(object):
|
class BasePageSizePagination(BasePagination):
|
||||||
# The default page size.
|
# The default page size.
|
||||||
# Defaults to `None`, meaning pagination is disabled.
|
# Defaults to `None`, meaning pagination is disabled.
|
||||||
page_size = api_settings.PAGE_SIZE
|
page_size = api_settings.PAGE_SIZE
|
||||||
|
@ -228,7 +228,7 @@ class PageSizePaginationMixin(object):
|
||||||
return self.page_size
|
return self.page_size
|
||||||
|
|
||||||
|
|
||||||
class PageNumberPagination(PageSizePaginationMixin, BasePagination):
|
class PageNumberPagination(BasePageSizePagination):
|
||||||
"""
|
"""
|
||||||
A simple page number based style that supports page numbers as
|
A simple page number based style that supports page numbers as
|
||||||
query parameters. For example:
|
query parameters. For example:
|
||||||
|
@ -487,7 +487,7 @@ class LimitOffsetPagination(BasePagination):
|
||||||
return template.render(context)
|
return template.render(context)
|
||||||
|
|
||||||
|
|
||||||
class CursorPagination(PageSizePaginationMixin, BasePagination):
|
class CursorPagination(BasePageSizePagination):
|
||||||
"""
|
"""
|
||||||
The cursor pagination implementation is neccessarily complex.
|
The cursor pagination implementation is neccessarily complex.
|
||||||
For an overview of the position/offset style we use, see this post:
|
For an overview of the position/offset style we use, see this post:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user