Merge pull request #270 from phobologic/master

Prevent serialization from recursing to self
This commit is contained in:
Tom Christie 2012-09-27 05:49:34 -07:00
commit b2259bad6b

View File

@ -210,6 +210,9 @@ class Serializer(object):
Given a model instance or dict, serialize it to a dict.. Given a model instance or dict, serialize it to a dict..
""" """
data = {} data = {}
# Append the instance itself to the stack so that you never iterate
# back into the first object.
self.stack.append(instance)
fields = self.get_fields(instance) fields = self.get_fields(instance)