MCPcopy
hub / github.com/django/django / DummyNode

Class DummyNode

django/db/migrations/graph.py:46–61  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

44
45
46class 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
64class MigrationGraph:

Callers 2

test_dummynode_reprMethod · 0.90
add_dummy_nodeMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_dummynode_reprMethod · 0.72