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

Function _first_models_module

tortoise/cli/utils.py:141–151  ·  view source on GitHub ↗
(models: Iterable[ModuleType | str] | str | None)

Source from the content-addressed store, hash-verified

139
140
141def _first_models_module(models: Iterable[ModuleType | str] | str | None) -> str | None:
142 if isinstance(models, str):
143 return models
144 if not models:
145 return None
146 for item in models:
147 if isinstance(item, str):
148 return item
149 if isinstance(item, ModuleType):
150 return item.__name__
151 return None
152
153
154def infer_migrations_module(models: Iterable[ModuleType | str] | str | None) -> str | None:

Callers 1

infer_migrations_moduleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…