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.
"""
if isinstance(obj, dict):
return dict([(key, self.to_native(val))
for (key, val) in obj.items()])
elif hasattr(obj, '__iter__'):
return [self.to_native(item) for item in obj]
if hasattr(obj, '__iter__'):
return [self.convert_object(item) for item in obj]
return self.convert_object(obj)
def from_native(self, data):