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

Function normalize_apps_config

tortoise/cli/utils.py:167–181  ·  view source on GitHub ↗
(apps_config: dict[str, dict[str, Any]])

Source from the content-addressed store, hash-verified

165
166
167def normalize_apps_config(apps_config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]]:
168 normalized: dict[str, dict[str, Any]] = {}
169 for label, config in apps_config.items():
170 updated = dict(config)
171 if "migrations" not in updated:
172 inferred = infer_migrations_module(updated.get("models"))
173 if inferred:
174 try:
175 if importlib.util.find_spec(inferred) is not None:
176 updated["migrations"] = inferred
177 except (ModuleNotFoundError, AttributeError, ValueError):
178 # Module doesn't exist or isn't a package - skip migrations inference
179 pass
180 normalized[label] = updated
181 return normalized

Callers

nothing calls this directly

Calls 3

infer_migrations_moduleFunction · 0.85
itemsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…