1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #4323: Add bulk edit view for power panels

This commit is contained in:
Jeremy Stretch
2020-03-06 16:05:26 -05:00
parent b22bf0c4b0
commit 2a5bf2a222
5 changed files with 52 additions and 3 deletions

View File

@@ -4621,6 +4621,35 @@ class PowerPanelCSVForm(forms.ModelForm):
)
class PowerPanelBulkEditForm(BootstrapMixin, BulkEditForm):
pk = forms.ModelMultipleChoiceField(
queryset=PowerPanel.objects.all(),
widget=forms.MultipleHiddenInput
)
site = DynamicModelChoiceField(
queryset=Site.objects.all(),
required=False,
widget=APISelect(
api_url="/api/dcim/sites/",
filter_for={
'rack_group': 'site_id',
}
)
)
rack_group = DynamicModelChoiceField(
queryset=RackGroup.objects.all(),
required=False,
widget=APISelect(
api_url="/api/dcim/rack-groups/"
)
)
class Meta:
nullable_fields = (
'rack_group',
)
class PowerPanelFilterForm(BootstrapMixin, CustomFieldFilterForm):
model = PowerPanel
q = forms.CharField(