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

Function _parse_targets

tortoise/migrations/api/migrate.py:66–76  ·  view source on GitHub ↗
(target: str | None, app_labels: Sequence[str])

Source from the content-addressed store, hash-verified

64
65
66def _parse_targets(target: str | None, app_labels: Sequence[str]) -> list[MigrationTarget]:
67 if not target:
68 return [MigrationTarget(app_label=label, name="__latest__") for label in app_labels]
69 if "." in target:
70 app_label, name = target.split(".", 1)
71 if app_label not in app_labels:
72 raise ValueError(f"Unknown app label {app_label}")
73 return [MigrationTarget(app_label=app_label, name=name)]
74 if target not in app_labels:
75 raise ValueError(f"Unknown app label {target}")
76 return [MigrationTarget(app_label=target, name="__latest__")]

Callers 1

migrateFunction · 0.70

Calls 1

MigrationTargetClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…