Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
Update datatypes.py to handle dict on properties
Browse files Browse the repository at this point in the history
As a dict's iterator returns keys, sending {"key" : "value"} resulted in receiving ["key"] on dashboard
Uses dict.iteritems() instead
  • Loading branch information
thibauddavid committed Nov 21, 2014
1 parent b7974f4 commit aae6c02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion parse_rest/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ def convert_to_parse(python_object, as_pointer=False):
if (hasattr(python_object, '__iter__') and
not isinstance(python_object, (six.string_types[0], ParseType))):
# It's an iterable? Repeat this whole process on each object
return [ParseType.convert_to_parse(o, as_pointer=as_pointer)
if isinstance(python_object, dict):
for key, value in python_object.iteritems():
python_object[key]=ParseType.convert_to_parse(value, as_pointer=as_pointer)
return python_object
else:
return [ParseType.convert_to_parse(o, as_pointer=as_pointer)
for o in python_object]

if python_type in transformation_map:
Expand Down

0 comments on commit aae6c02

Please sign in to comment.