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

Method __init__

tortoise/migrations/operations.py:1082–1096  ·  view source on GitHub ↗
(
        self,
        code,
        reverse_code=None,
        *,
        atomic: bool | None = None,
    )

Source from the content-addressed store, hash-verified

1080 reduces_to_sql = False
1081
1082 def __init__(
1083 self,
1084 code,
1085 reverse_code=None,
1086 *,
1087 atomic: bool | None = None,
1088 ) -> None:
1089 if not callable(code):
1090 raise ValueError("RunPython must be supplied with a callable")
1091 if reverse_code is not None and not callable(reverse_code):
1092 raise ValueError("RunPython must be supplied with callable arguments")
1093 self.code = code
1094 self.reverse_code = reverse_code
1095 self.atomic = atomic
1096 self.reversible = reverse_code is not None
1097
1098 def describe(self) -> str:
1099 return "Run Python code"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected