1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Introduce PathContains lookup to allow filtering against objects in path directly

This commit is contained in:
Jeremy Stretch
2020-10-06 09:41:45 -04:00
parent 19430ddeb5
commit 56ee425227
6 changed files with 21 additions and 16 deletions

View File

@ -8,10 +8,6 @@ def object_to_path_node(obj):
return f'{obj._meta.model_name}:{obj.pk}'
def objects_to_path(*obj_list):
return [object_to_path_node(obj) for obj in obj_list]
def path_node_to_object(repr):
model_name, object_id = repr.split(':')
model_class = ContentType.objects.get(model=model_name).model_class()