MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / init_models

Method init_models

tortoise/__init__.py:213–231  ·  view source on GitHub ↗

Early initialisation of Tortoise ORM Models. Initialise the relationships between Models. This does not initialise any database connection. :param models_paths: Models paths to initialise :param app_label: The app label, e.g. 'models' :param _init_r

(
        cls,
        models_paths: Iterable[ModuleType | str],
        app_label: str,
        _init_relations: bool = True,
    )

Source from the content-addressed store, hash-verified

211
212 @classmethod
213 def init_models(
214 cls,
215 models_paths: Iterable[ModuleType | str],
216 app_label: str,
217 _init_relations: bool = True,
218 ) -> None:
219 """
220 Early initialisation of Tortoise ORM Models.
221
222 Initialise the relationships between Models.
223 This does not initialise any database connection.
224
225 :param models_paths: Models paths to initialise
226 :param app_label: The app label, e.g. 'models'
227 :param _init_relations: Whether to init relations or not
228
229 :raises ConfigurationError: If models are invalid.
230 """
231 cls.init_app(app_label, models_paths, _init_relations=_init_relations)
232
233 @classmethod
234 def init_app(

Callers 5

test_early_initFunction · 0.80
tutorial_4.pyFile · 0.80
early_init.pyFile · 0.80
computed_fields.pyFile · 0.80
tutorial_3.pyFile · 0.80

Calls 1

init_appMethod · 0.45

Tested by 1

test_early_initFunction · 0.64