mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
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:
commit
a72f812d80
|
@ -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'
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user