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

Method __init__

tortoise/apps.py:28–42  ·  view source on GitHub ↗
(
        self,
        config: dict[str, dict[str, Any]] | None,
        connections: ConnectionHandler,
        table_name_generator: Callable[[type[Model]], str] | None = None,
        *,
        validate_connections: bool = True,
    )

Source from the content-addressed store, hash-verified

26
27class Apps:
28 def __init__(
29 self,
30 config: dict[str, dict[str, Any]] | None,
31 connections: ConnectionHandler,
32 table_name_generator: Callable[[type[Model]], str] | None = None,
33 *,
34 validate_connections: bool = True,
35 ) -> None:
36 self.apps: dict[str, dict[str, type[Model]]] = {}
37 self._config = config or {}
38 self._connections = connections
39 self._table_name_generator = table_name_generator
40 self._validate_connections = validate_connections
41 if self._config:
42 self._load_from_config()
43
44 @staticmethod
45 def _discover_models(models_path: ModuleType | str, app_label: str) -> list[type[Model]]:

Callers

nothing calls this directly

Calls 1

_load_from_configMethod · 0.95

Tested by

no test coverage detected