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

Method default_name

tortoise/fields/base.py:514–519  ·  view source on GitHub ↗
(default: Any)

Source from the content-addressed store, hash-verified

512 return str(typ)
513
514 def default_name(default: Any) -> int | float | str | bool | None:
515 if isinstance(default, (int, float, str, bool, type(None))):
516 return default
517 if callable(default):
518 return f"<function {default.__module__}.{default.__name__}>"
519 return str(default)
520
521 field_type = getattr(self, "related_model", self.field_type)
522

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected