Commit 5cde5c6a by José Padilla

Merge pull request #3642 from willdady/master

Removing references to get_paginate_by() as it no longer exists.
parents 316c374b ca084157
...@@ -35,14 +35,6 @@ For more complex cases you might also want to override various methods on the vi ...@@ -35,14 +35,6 @@ For more complex cases you might also want to override various methods on the vi
serializer_class = UserSerializer serializer_class = UserSerializer
permission_classes = (IsAdminUser,) permission_classes = (IsAdminUser,)
def get_paginate_by(self):
"""
Use smaller pagination for HTML representations.
"""
if self.request.accepted_renderer.format == 'html':
return 20
return 100
def list(self, request): def list(self, request):
# Note the use of `get_queryset()` instead of `self.queryset` # Note the use of `get_queryset()` instead of `self.queryset`
queryset = self.get_queryset() queryset = self.get_queryset()
...@@ -156,19 +148,6 @@ For example: ...@@ -156,19 +148,6 @@ For example:
return FullAccountSerializer return FullAccountSerializer
return BasicAccountSerializer return BasicAccountSerializer
#### `get_paginate_by(self)`
Returns the page size to use with pagination. By default this uses the `paginate_by` attribute, and may be overridden by the client if the `paginate_by_param` attribute is set.
You may want to override this method to provide more complex behavior, such as modifying page sizes based on the media type of the response.
For example:
def get_paginate_by(self):
if self.request.accepted_renderer.format == 'html':
return 20
return 100
**Save and deletion hooks**: **Save and deletion hooks**:
The following methods are provided by the mixin classes, and provide easy overriding of the object save or deletion behavior. The following methods are provided by the mixin classes, and provide easy overriding of the object save or deletion behavior.
...@@ -416,5 +395,3 @@ The [django-rest-framework-bulk package][django-rest-framework-bulk] implements ...@@ -416,5 +395,3 @@ The [django-rest-framework-bulk package][django-rest-framework-bulk] implements
[DestroyModelMixin]: #destroymodelmixin [DestroyModelMixin]: #destroymodelmixin
[django-rest-framework-bulk]: https://github.com/miki725/django-rest-framework-bulk [django-rest-framework-bulk]: https://github.com/miki725/django-rest-framework-bulk
[django-rest-multiple-models]: https://github.com/Axiologue/DjangoRestMultipleModels [django-rest-multiple-models]: https://github.com/Axiologue/DjangoRestMultipleModels
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment