mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-15 12:08:17 -06:00
feat: Ability to do global search by tag
This commit is contained in:
parent
79bebf7c9b
commit
d5bdc3f567
@ -22,6 +22,9 @@ from utilities.utils import count_related
|
||||
from virtualization.filtersets import ClusterFilterSet, VirtualMachineFilterSet
|
||||
from virtualization.models import Cluster, VirtualMachine
|
||||
from virtualization.tables import ClusterTable, VirtualMachineTable
|
||||
from extras.filtersets import TagFilterSet
|
||||
from extras.models import Tag
|
||||
from extras.tables import TagTable
|
||||
|
||||
SEARCH_MAX_RESULTS = 15
|
||||
SEARCH_TYPES = OrderedDict((
|
||||
@ -177,4 +180,11 @@ SEARCH_TYPES = OrderedDict((
|
||||
'table': TenantTable,
|
||||
'url': 'tenancy:tenant_list',
|
||||
}),
|
||||
# Other
|
||||
('tag', {
|
||||
'queryset': Tag.objects.prefetch_related('prefix'),
|
||||
'filterset': TagFilterSet,
|
||||
'table': TagTable,
|
||||
'url': 'extras:tag_list',
|
||||
}),
|
||||
))
|
||||
|
@ -33,6 +33,9 @@ OBJ_TYPE_CHOICES = (
|
||||
('cluster', 'Clusters'),
|
||||
('virtualmachine', 'Virtual Machines'),
|
||||
)),
|
||||
('Other', (
|
||||
('tag', 'Tags'),
|
||||
)),
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user