aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlen Mujezinovic2012-03-01 12:46:38 +0000
committerAlen Mujezinovic2012-03-01 12:46:38 +0000
commit54a19105f051113085efe9f87783acb77127c1d1 (patch)
tree5a98c39634cdff038ba69a9ff5e879f6f2bc0f00
parent55317b03725dcfba5c3fd5b06b7c507fff69ff13 (diff)
downloaddjango-rest-framework-54a19105f051113085efe9f87783acb77127c1d1.tar.bz2
Maintain a reference to the parent serializer when descending down into fields
-rw-r--r--djangorestframework/serializer.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/djangorestframework/serializer.py b/djangorestframework/serializer.py
index 5dea37e8..e2d860a2 100644
--- a/djangorestframework/serializer.py
+++ b/djangorestframework/serializer.py
@@ -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)