MCPcopy
hub / github.com/django/django / root_nodes

Method root_nodes

django/db/migrations/graph.py:242–253  ·  view source on GitHub ↗

Return all root nodes - that is, nodes with no dependencies inside their app. These are the starting point for an app.

(self, app=None)

Source from the content-addressed store, hash-verified

240 return visited
241
242 def root_nodes(self, app=None):
243 """
244 Return all root nodes - that is, nodes with no dependencies inside
245 their app. These are the starting point for an app.
246 """
247 roots = set()
248 for node in self.nodes:
249 if all(key[0] != node[0] for key in self.node_map[node].parents) and (
250 not app or app == node[0]
251 ):
252 roots.add(node)
253 return sorted(roots)
254
255 def leaf_nodes(self, app=None):
256 """

Callers 4

test_simple_graphMethod · 0.95
test_complex_graphMethod · 0.95
check_keyMethod · 0.80
migration_planMethod · 0.80

Calls 1

addMethod · 0.45

Tested by 2

test_simple_graphMethod · 0.76
test_complex_graphMethod · 0.76