mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 18:13:57 +03:00
Maintain a reference to the parent serializer when descending down into fields
This commit is contained in:
parent
55317b0372
commit
54a19105f0
|
@ -133,6 +133,7 @@ class Serializer(object):
|
|||
if isinstance(info, (list, tuple)):
|
||||
class OnTheFlySerializer(self.__class__):
|
||||
fields = info
|
||||
parent = getattr(self, 'parent', self)
|
||||
return OnTheFlySerializer
|
||||
|
||||
# If an element in `fields` is a 2-tuple of (str, Serializer)
|
||||
|
|
Loading…
Reference in New Issue
Block a user