MCPcopy
hub / github.com/django/django / Node

Class Node

django/db/migrations/graph.py:10–43  ·  view source on GitHub ↗

A single node in the migration graph. Contains direct links to adjacent nodes in either direction.

Source from the content-addressed store, hash-verified

8
9@total_ordering
10class Node:
11 """
12 A single node in the migration graph. Contains direct links to adjacent
13 nodes in either direction.
14 """
15
16 def __init__(self, key):
17 self.key = key
18 self.children = set()
19 self.parents = set()
20
21 def __eq__(self, other):
22 return self.key == other
23
24 def __lt__(self, other):
25 return self.key < other
26
27 def __hash__(self):
28 return hash(self.key)
29
30 def __getitem__(self, item):
31 return self.key[item]
32
33 def __str__(self):
34 return str(self.key)
35
36 def __repr__(self):
37 return "<%s: (%r, %r)>" % (self.__class__.__name__, self.key[0], self.key[1])
38
39 def add_child(self, child):
40 self.children.add(child)
41
42 def add_parent(self, parent):
43 self.parents.add(parent)
44
45
46class DummyNode(Node):

Callers 3

test_node_reprMethod · 0.90
test_node_strMethod · 0.90
add_nodeMethod · 0.70

Calls

no outgoing calls

Tested by 2

test_node_reprMethod · 0.72
test_node_strMethod · 0.72