MCPcopy
hub / github.com/tortoise/tortoise-orm / __post_init__

Method __post_init__

tortoise/config.py:68–77  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 migrations: str | None = None
67
68 def __post_init__(self) -> None:
69 if not isinstance(self.models, list) or not self.models:
70 raise ConfigurationError("AppConfig.models must be a non-empty list of strings")
71 for model in self.models:
72 if not isinstance(model, str) or not model:
73 raise ConfigurationError("AppConfig.models must contain non-empty strings")
74 if self.default_connection is not None and not isinstance(self.default_connection, str):
75 raise ConfigurationError("AppConfig.default_connection must be a string or None")
76 if self.migrations is not None and not isinstance(self.migrations, str):
77 raise ConfigurationError("AppConfig.migrations must be a string or None")
78
79 def to_dict(self) -> dict[str, Any]:
80 data: dict[str, Any] = {"models": self.models}

Callers

nothing calls this directly

Calls 1

ConfigurationErrorClass · 0.90

Tested by

no test coverage detected