mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Drop unneccesarily lenient dictionary-containing-instances serialization.
This commit is contained in:
parent
33be4b43b9
commit
6d201c362f
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user