MCPcopy
hub / github.com/tortoise/tortoise-orm / _parse_targets

Function _parse_targets

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

Source from the content-addressed store, hash-verified

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

Callers 1

planFunction · 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…