Drop unneccesarily lenient dictionary-containing-instances serialization.

This commit is contained in:
Tom Christie 2012-11-05 16:19:11 +00:00
parent 33be4b43b9
commit 6d201c362f

View File

@ -246,11 +246,8 @@ class BaseSerializer(Field):
""" """
Serialize objects -> primatives. Serialize objects -> primatives.
""" """
if isinstance(obj, dict): if hasattr(obj, '__iter__'):
return dict([(key, self.to_native(val)) return [self.convert_object(item) for item in obj]
for (key, val) in obj.items()])
elif hasattr(obj, '__iter__'):
return [self.to_native(item) for item in obj]
return self.convert_object(obj) return self.convert_object(obj)
def from_native(self, data): def from_native(self, data):