Commit 54a19105 by Alen Mujezinovic

Maintain a reference to the parent serializer when descending down into fields

parent 55317b03
...@@ -133,6 +133,7 @@ class Serializer(object): ...@@ -133,6 +133,7 @@ class Serializer(object):
if isinstance(info, (list, tuple)): if isinstance(info, (list, tuple)):
class OnTheFlySerializer(self.__class__): class OnTheFlySerializer(self.__class__):
fields = info fields = info
parent = getattr(self, 'parent', self)
return OnTheFlySerializer return OnTheFlySerializer
# If an element in `fields` is a 2-tuple of (str, Serializer) # If an element in `fields` is a 2-tuple of (str, Serializer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment