(
self,
label: str,
module_list: Iterable[ModuleType | str],
_init_relations: bool = True,
)
| 69 | return discovered_models |
| 70 | |
| 71 | def init_app( |
| 72 | self, |
| 73 | label: str, |
| 74 | module_list: Iterable[ModuleType | str], |
| 75 | _init_relations: bool = True, |
| 76 | ) -> dict[str, type[Model]]: |
| 77 | app_models: list[type[Model]] = [] |
| 78 | for module in module_list: |
| 79 | app_models += self._discover_models(module, label) |
| 80 | |
| 81 | self.apps[label] = {model.__name__: model for model in app_models} |
| 82 | |
| 83 | if _init_relations: |
| 84 | self._init_relations() |
| 85 | |
| 86 | return self.apps[label] |
| 87 | |
| 88 | def _load_from_config(self) -> None: |
| 89 | if self._connections is None: |
no test coverage detected