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:
@ -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()
|
||||
|
Reference in New Issue
Block a user