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

@@ -4,7 +4,7 @@ from django.test import TestCase
from circuits.models import *
from dcim.choices import CableStatusChoices
from dcim.models import *
from dcim.utils import objects_to_path
from dcim.utils import object_to_path_node
class CablePathTestCase(TestCase):
@@ -146,7 +146,7 @@ class CablePathTestCase(TestCase):
kwargs['destination_type__isnull'] = True
kwargs['destination_id__isnull'] = True
if path is not None:
kwargs['path'] = objects_to_path(*path)
kwargs['path'] = [object_to_path_node(obj) for obj in path]
if is_active is not None:
kwargs['is_active'] = is_active
if msg is None: