mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
paginated_response_values will be retrieved through a seperated function
This commit is contained in:
parent
efc7c1d664
commit
067dfbdd23
|
@ -222,12 +222,15 @@ class PageNumberPagination(BasePagination):
|
||||||
return page_number
|
return page_number
|
||||||
|
|
||||||
def get_paginated_response(self, data):
|
def get_paginated_response(self, data):
|
||||||
return Response(OrderedDict([
|
return Response(self.get_paginated_response_values(data))
|
||||||
|
|
||||||
|
def get_paginated_response_values(self, data):
|
||||||
|
return OrderedDict([
|
||||||
('count', self.page.paginator.count),
|
('count', self.page.paginator.count),
|
||||||
('next', self.get_next_link()),
|
('next', self.get_next_link()),
|
||||||
('previous', self.get_previous_link()),
|
('previous', self.get_previous_link()),
|
||||||
('results', data)
|
('results', data)
|
||||||
]))
|
])
|
||||||
|
|
||||||
def get_paginated_response_schema(self, schema):
|
def get_paginated_response_schema(self, schema):
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user