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

Method to_python

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

Source from the content-addressed store, hash-verified

690 self.error("Only datetime objects may used in a ComplexDateTimeField")
691
692 def to_python(self, value):
693 original_value = value
694 try:
695 return self._convert_from_string(value)
696 except Exception:
697 return original_value
698
699 def to_mongo(self, value):
700 value = self.to_python(value)

Callers 2

validateMethod · 0.95
to_mongoMethod · 0.95

Calls 1

_convert_from_stringMethod · 0.95

Tested by

no test coverage detected