mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 22:49:50 +03:00
Don't attempt to convert dictionary keys
This commit is contained in:
parent
497da7fc69
commit
5a1df32035
|
@ -283,7 +283,7 @@ class BaseSerializer(Field):
|
|||
"""
|
||||
Serialize objects -> primitives.
|
||||
"""
|
||||
if hasattr(obj, '__iter__'):
|
||||
if hasattr(obj, '__iter__') and not hasattr(obj, '__dict__'):
|
||||
return [self.convert_object(item) for item in obj]
|
||||
return self.convert_object(obj)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user