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

Change serializers.Field to serializers.ReadOnlyField for 3.x compatibility
This commit is contained in:
Tom Christie 2014-12-13 19:54:19 +00:00
commit a72f812d80

View File

@ -128,7 +128,7 @@ For example, to nest a pair of links labelled 'prev' and 'next', and set the nam
class CustomPaginationSerializer(pagination.BasePaginationSerializer):
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'