mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 01:47:59 +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):
 | 
					    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'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user