|
@@ -2106,6 +2106,10 @@ class PowerOutletBulkEditForm(BootstrapMixin, AddRemoveTagsForm, BulkEditForm):
|
|
|
choices=add_blank_choice(POWERFEED_LEG_CHOICES),
|
|
choices=add_blank_choice(POWERFEED_LEG_CHOICES),
|
|
|
required=False,
|
|
required=False,
|
|
|
)
|
|
)
|
|
|
|
|
+ power_port = forms.ModelChoiceField(
|
|
|
|
|
+ queryset=PowerPort.objects.all(),
|
|
|
|
|
+ required=False
|
|
|
|
|
+ )
|
|
|
description = forms.CharField(
|
|
description = forms.CharField(
|
|
|
max_length=100,
|
|
max_length=100,
|
|
|
required=False
|
|
required=False
|
|
@@ -2113,9 +2117,15 @@ class PowerOutletBulkEditForm(BootstrapMixin, AddRemoveTagsForm, BulkEditForm):
|
|
|
|
|
|
|
|
class Meta:
|
|
class Meta:
|
|
|
nullable_fields = [
|
|
nullable_fields = [
|
|
|
- 'feed_leg', 'description',
|
|
|
|
|
|
|
+ 'feed_leg', 'power_port', 'description',
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
+ def __init__(self, *args, **kwargs):
|
|
|
|
|
+ super().__init__(*args, **kwargs)
|
|
|
|
|
+
|
|
|
|
|
+ # Limit power_port queryset to PowerPorts which belong to the parent Device
|
|
|
|
|
+ self.fields['power_port'].queryset = PowerPort.objects.filter(device=self.parent_obj)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class PowerOutletBulkRenameForm(BulkRenameForm):
|
|
class PowerOutletBulkRenameForm(BulkRenameForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|