MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / to_python

Method to_python

mongoengine/fields.py:885–892  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

883 return value
884
885 def to_python(self, value):
886 if isinstance(value, dict) and "_cls" in value:
887 doc_cls = get_document(value["_cls"])
888 if "_ref" in value:
889 value = doc_cls._get_db().dereference(value["_ref"])
890 return doc_cls._from_son(value)
891
892 return super().to_python(value)
893
894 def lookup_member(self, member_name):
895 return member_name

Callers

nothing calls this directly

Calls 4

get_documentFunction · 0.90
_get_dbMethod · 0.80
_from_sonMethod · 0.80
to_pythonMethod · 0.45

Tested by

no test coverage detected