Skip to content

Commit

Permalink
fix for issue MongoEngine#904: error while using "db_field" parameter…
Browse files Browse the repository at this point in the history
… in multi-level embedded documents
  • Loading branch information
manuel committed Apr 5, 2015
1 parent a092910 commit cf02f4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mongoengine/base/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def _from_son(cls, son, _auto_dereference=True, only_fields=None, created=False)
# get the class name from the document, falling back to the given
# class if unavailable
class_name = son.get('_cls', cls._class_name)
data = dict(("%s" % key, value) for key, value in son.iteritems())
data = dict(("%s" % cls._db_field_map.get(key,key), value) for key, value in son.iteritems())

# Return correct subclass for document type
if class_name != cls._class_name:
Expand Down

0 comments on commit cf02f4f

Please sign in to comment.