MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / to_python_value

Method to_python_value

tortoise/fields/data.py:966–967  ·  view source on GitHub ↗
(self, value: str | None)

Source from the content-addressed store, hash-verified

964 self.enum_type = enum_type
965
966 def to_python_value(self, value: str | None) -> Enum | None:
967 return self.enum_type(value) if value is not None else None
968
969 def to_db_value(self, value: Enum | None | str, instance: type[Model] | Model) -> str | None:
970 self.validate(value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected