mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Migrate CablePath to use two-dimensional array
This commit is contained in:
@ -29,6 +29,16 @@ def path_node_to_object(repr):
|
||||
return ct.model_class().objects.get(pk=object_id)
|
||||
|
||||
|
||||
def flatten_path(path):
|
||||
"""
|
||||
Flatten a two-dimensional array (list of lists) into a flat list.
|
||||
"""
|
||||
ret = []
|
||||
for step in path:
|
||||
ret.extend(step)
|
||||
return ret
|
||||
|
||||
|
||||
def create_cablepath(node):
|
||||
"""
|
||||
Create CablePaths for all paths originating from the specified node.
|
||||
|
Reference in New Issue
Block a user