diff options
| author | Tom Christie | 2012-10-19 19:59:46 +0100 | 
|---|---|---|
| committer | Tom Christie | 2012-10-19 19:59:55 +0100 | 
| commit | efabd2bb1b762fbdee2b48fa3a6ccb8f23c7e8dc (patch) | |
| tree | 7079d77c9e1bb40a229d8d6b4f871aaa8c59155d /docs/api-guide/pagination.md | |
| parent | 46dffbd5b9fcb60885067bdf65c9d63db25f543b (diff) | |
| download | django-rest-framework-efabd2bb1b762fbdee2b48fa3a6ccb8f23c7e8dc.tar.bz2 | |
docs, docs, docs, docs, docs, docs, docs
Diffstat (limited to 'docs/api-guide/pagination.md')
| -rw-r--r-- | docs/api-guide/pagination.md | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/docs/api-guide/pagination.md b/docs/api-guide/pagination.md index e416de02..597baba4 100644 --- a/docs/api-guide/pagination.md +++ b/docs/api-guide/pagination.md @@ -100,12 +100,16 @@ You can also set the pagination style on a per-view basis, using the `ListAPIVie  For more complex requirements such as serialization that differs depending on the requested media type you can override the `.get_paginate_by()` and `.get_pagination_serializer_class()` methods. -## Custom pagination serializers +--- + +# Custom pagination serializers  To create a custom pagination serializer class you should override `pagination.BasePaginationSerializer` and set the fields that you want the serializer to return.  You can also override the name used for the object list field, by setting the `results_field` attribute, which defaults to `'results'`. +## Example +  For example, to nest a pair of links labelled 'prev' and 'next', and set the name for the results field to 'objects', you might use something like this.      class LinksSerializer(serializers.Serializer): | 
