MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / to_python_value

Method to_python_value

tortoise/fields/base.py:317–325  ·  view source on GitHub ↗

Converts from the DB type to the Python type. :param value: Value from DB

(self, value: Any)

Source from the content-addressed store, hash-verified

315 return value
316
317 def to_python_value(self, value: Any) -> Any:
318 """
319 Converts from the DB type to the Python type.
320
321 :param value: Value from DB
322 """
323 if value is not None and not isinstance(value, self.field_type):
324 value = self.field_type(value) # pylint: disable=E1102
325 return value
326
327 def validate(self, value: Any) -> None:
328 """

Callers 7

_set_kwargsMethod · 0.45
_init_from_dbMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected