Skip to content

Commit

Permalink
Adds device and vm to service filter form (#14215)
Browse files Browse the repository at this point in the history
* adds device and vm to service filter form #13951

* Tweak labels

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
  • Loading branch information
abhi1693 and jeremystretch authored Nov 9, 2023
1 parent dfef89a commit 95519b4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions netbox/ipam/forms/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,21 @@ class ServiceTemplateFilterForm(NetBoxModelFilterSetForm):

class ServiceFilterForm(ServiceTemplateFilterForm):
model = Service
fieldsets = (
(None, ('q', 'filter_id', 'tag')),
(_('Attributes'), ('protocol', 'port')),
(_('Assignment'), ('device_id', 'virtual_machine_id')),
)
device_id = DynamicModelMultipleChoiceField(
queryset=Device.objects.all(),
required=False,
label=_('Device'),
)
virtual_machine_id = DynamicModelMultipleChoiceField(
queryset=VirtualMachine.objects.all(),
required=False,
label=_('Virtual Machine'),
)
tag = TagFilterField(model)


Expand Down

0 comments on commit 95519b4

Please sign in to comment.