A node that doesn't correspond to a migration file on disk. (A squashed migration that was removed, for example.) After the migration graph is processed, all dummy nodes should be removed. If there are any left, a nonexistent dependency error is raised.
| 44 | |
| 45 | |
| 46 | class DummyNode(Node): |
| 47 | """ |
| 48 | A node that doesn't correspond to a migration file on disk. |
| 49 | (A squashed migration that was removed, for example.) |
| 50 | |
| 51 | After the migration graph is processed, all dummy nodes should be removed. |
| 52 | If there are any left, a nonexistent dependency error is raised. |
| 53 | """ |
| 54 | |
| 55 | def __init__(self, key, origin, error_message): |
| 56 | super().__init__(key) |
| 57 | self.origin = origin |
| 58 | self.error_message = error_message |
| 59 | |
| 60 | def raise_error(self): |
| 61 | raise NodeNotFoundError(self.error_message, self.key, origin=self.origin) |
| 62 | |
| 63 | |
| 64 | class MigrationGraph: |
no outgoing calls