mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
This commit is contained in:
parent
cf52c0e044
commit
b7abf14d3a
|
@ -62,7 +62,13 @@ class BasePaginationSerializer(serializers.Serializer):
|
||||||
super(BasePaginationSerializer, self).__init__(*args, **kwargs)
|
super(BasePaginationSerializer, self).__init__(*args, **kwargs)
|
||||||
results_field = self.results_field
|
results_field = self.results_field
|
||||||
object_serializer = self.opts.object_serializer_class
|
object_serializer = self.opts.object_serializer_class
|
||||||
self.fields[results_field] = object_serializer(source='object_list')
|
|
||||||
|
if 'context' in kwargs:
|
||||||
|
context_kwarg = {'context': kwargs['context']}
|
||||||
|
else:
|
||||||
|
context_kwarg = {}
|
||||||
|
|
||||||
|
self.fields[results_field] = object_serializer(source='object_list', **context_kwarg)
|
||||||
|
|
||||||
def to_native(self, obj):
|
def to_native(self, obj):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user