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

Method to_python_value

tortoise/fields/data.py:903–905  ·  view source on GitHub ↗
(self, value: int | None)

Source from the content-addressed store, hash-verified

901 self.enum_type = enum_type
902
903 def to_python_value(self, value: int | None) -> IntEnum | None:
904 value = self.enum_type(value) if value is not None else None
905 return value
906
907 def to_db_value(self, value: IntEnum | None | int, instance: type[Model] | Model) -> int | None:
908 if isinstance(value, IntEnum):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected