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

Method to_python

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

Source from the content-addressed store, hash-verified

1323 self.owner_document.objects(**filter_kwargs).update(**update_kwargs)
1324
1325 def to_python(self, value):
1326 if isinstance(value, dict):
1327 collection = self.document_type._get_collection_name()
1328 value = DBRef(collection, self.document_type.id.to_python(value["_id"]))
1329 return self.document_type._from_son(
1330 self.document_type._get_db().dereference(value)
1331 )
1332
1333 return value
1334
1335 @property
1336 def document_type(self):

Callers

nothing calls this directly

Calls 4

_from_sonMethod · 0.80
_get_dbMethod · 0.80
_get_collection_nameMethod · 0.45
to_pythonMethod · 0.45

Tested by

no test coverage detected