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:
10
netbox/dcim/lookups.py
Normal file
10
netbox/dcim/lookups.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.contrib.postgres.fields.array import ArrayContains
|
||||
|
||||
from dcim.utils import object_to_path_node
|
||||
|
||||
|
||||
class PathContains(ArrayContains):
|
||||
|
||||
def get_prep_lookup(self):
|
||||
self.rhs = [object_to_path_node(self.rhs)]
|
||||
return super().get_prep_lookup()
|
Reference in New Issue
Block a user