Commit a72f812d by Tom Christie

Merge pull request #2269 from bjacobel/bjacobel/documentation-pagination-readonlyfield

Change serializers.Field to serializers.ReadOnlyField for 3.x compatibility
parents dd712a1c 2d470eef
...@@ -128,7 +128,7 @@ For example, to nest a pair of links labelled 'prev' and 'next', and set the nam ...@@ -128,7 +128,7 @@ For example, to nest a pair of links labelled 'prev' and 'next', and set the nam
class CustomPaginationSerializer(pagination.BasePaginationSerializer): class CustomPaginationSerializer(pagination.BasePaginationSerializer):
links = LinksSerializer(source='*') # Takes the page object as the source links = LinksSerializer(source='*') # Takes the page object as the source
total_results = serializers.Field(source='paginator.count') total_results = serializers.ReadOnlyField(source='paginator.count')
results_field = 'objects' results_field = 'objects'
......
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