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

Method to_python_value

tortoise/fields/data.py:383–386  ·  view source on GitHub ↗
(self, value: Any)

Source from the content-addressed store, hash-verified

381 self.quant = Decimal("1" if decimal_places == 0 else f"1.{('0' * decimal_places)}")
382
383 def to_python_value(self, value: Any) -> Decimal | None:
384 if value is not None:
385 value = Decimal(value).quantize(self.quant).normalize()
386 return value
387
388 @property
389 def SQL_TYPE(self) -> str: # type: ignore

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected