|
@@ -6,8 +6,8 @@ from timezone_field import TimeZoneFormField
|
|
|
from dcim.choices import *
|
|
from dcim.choices import *
|
|
|
from dcim.constants import *
|
|
from dcim.constants import *
|
|
|
from dcim.models import *
|
|
from dcim.models import *
|
|
|
-from extras.forms import AddRemoveTagsForm, CustomFieldModelBulkEditForm
|
|
|
|
|
from ipam.models import ASN, VLAN, VRF
|
|
from ipam.models import ASN, VLAN, VRF
|
|
|
|
|
+from netbox.forms import NetBoxModelBulkEditForm
|
|
|
from tenancy.models import Tenant
|
|
from tenancy.models import Tenant
|
|
|
from utilities.forms import (
|
|
from utilities.forms import (
|
|
|
add_blank_choice, BulkEditForm, BulkEditNullBooleanSelect, ColorField, CommentField, DynamicModelChoiceField,
|
|
add_blank_choice, BulkEditForm, BulkEditNullBooleanSelect, ColorField, CommentField, DynamicModelChoiceField,
|
|
@@ -57,7 +57,7 @@ __all__ = (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class RegionBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class RegionBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Region.objects.all(),
|
|
queryset=Region.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -71,11 +71,10 @@ class RegionBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['parent', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('parent', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
-class SiteGroupBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class SiteGroupBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=SiteGroup.objects.all(),
|
|
queryset=SiteGroup.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -89,11 +88,10 @@ class SiteGroupBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['parent', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('parent', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
-class SiteBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class SiteBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Site.objects.all(),
|
|
queryset=Site.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -131,13 +129,12 @@ class SiteBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
widget=StaticSelect()
|
|
widget=StaticSelect()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = [
|
|
|
|
|
- 'region', 'group', 'tenant', 'asns', 'description', 'time_zone',
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ nullable_fields = (
|
|
|
|
|
+ 'region', 'group', 'tenant', 'asns', 'description', 'time_zone',
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
|
-class LocationBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class LocationBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Location.objects.all(),
|
|
queryset=Location.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -162,11 +159,10 @@ class LocationBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['parent', 'tenant', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('parent', 'tenant', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
-class RackRoleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class RackRoleBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=RackRole.objects.all(),
|
|
queryset=RackRole.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -179,11 +175,10 @@ class RackRoleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['color', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('color', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
-class RackBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class RackBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Rack.objects.all(),
|
|
queryset=Rack.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -277,13 +272,12 @@ class RackBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
label='Comments'
|
|
label='Comments'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = [
|
|
|
|
|
- 'location', 'tenant', 'role', 'serial', 'asset_tag', 'outer_width', 'outer_depth', 'outer_unit', 'comments',
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ nullable_fields = (
|
|
|
|
|
+ 'location', 'tenant', 'role', 'serial', 'asset_tag', 'outer_width', 'outer_depth', 'outer_unit', 'comments',
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
|
-class RackReservationBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class RackReservationBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=RackReservation.objects.all(),
|
|
queryset=RackReservation.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
@@ -304,11 +298,8 @@ class RackReservationBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditFor
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = []
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
-class ManufacturerBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class ManufacturerBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Manufacturer.objects.all(),
|
|
queryset=Manufacturer.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -318,11 +309,10 @@ class ManufacturerBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['description']
|
|
|
|
|
|
|
+ nullable_fields = ('description',)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class DeviceTypeBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class DeviceTypeBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=DeviceType.objects.all(),
|
|
queryset=DeviceType.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
@@ -349,11 +339,10 @@ class DeviceTypeBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
widget=StaticSelect()
|
|
widget=StaticSelect()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['part_number', 'airflow']
|
|
|
|
|
|
|
+ nullable_fields = ('part_number', 'airflow')
|
|
|
|
|
|
|
|
|
|
|
|
|
-class ModuleTypeBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class ModuleTypeBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=ModuleType.objects.all(),
|
|
queryset=ModuleType.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
@@ -366,11 +355,10 @@ class ModuleTypeBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['part_number']
|
|
|
|
|
|
|
+ nullable_fields = ('part_number',)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class DeviceRoleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class DeviceRoleBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=DeviceRole.objects.all(),
|
|
queryset=DeviceRole.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -388,11 +376,10 @@ class DeviceRoleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['color', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('color', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
-class PlatformBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class PlatformBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Platform.objects.all(),
|
|
queryset=Platform.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -411,11 +398,10 @@ class PlatformBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['manufacturer', 'napalm_driver', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('manufacturer', 'napalm_driver', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
-class DeviceBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class DeviceBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Device.objects.all(),
|
|
queryset=Device.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
@@ -470,13 +456,12 @@ class DeviceBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
label='Serial Number'
|
|
label='Serial Number'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = [
|
|
|
|
|
- 'tenant', 'platform', 'serial', 'airflow',
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ nullable_fields = (
|
|
|
|
|
+ 'tenant', 'platform', 'serial', 'airflow',
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
|
|
|
-class ModuleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class ModuleBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Module.objects.all(),
|
|
queryset=Module.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
@@ -498,11 +483,10 @@ class ModuleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
label='Serial Number'
|
|
label='Serial Number'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['serial']
|
|
|
|
|
|
|
+ nullable_fields = ('serial',)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class CableBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class CableBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Cable.objects.all(),
|
|
queryset=Cable.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -541,10 +525,9 @@ class CableBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
widget=StaticSelect()
|
|
widget=StaticSelect()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = [
|
|
|
|
|
- 'type', 'status', 'tenant', 'label', 'color', 'length',
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ nullable_fields = (
|
|
|
|
|
+ 'type', 'status', 'tenant', 'label', 'color', 'length',
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
def clean(self):
|
|
def clean(self):
|
|
|
super().clean()
|
|
super().clean()
|
|
@@ -558,7 +541,7 @@ class CableBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
-class VirtualChassisBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class VirtualChassisBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=VirtualChassis.objects.all(),
|
|
queryset=VirtualChassis.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
@@ -568,11 +551,10 @@ class VirtualChassisBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['domain']
|
|
|
|
|
|
|
+ nullable_fields = ('domain',)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class PowerPanelBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class PowerPanelBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=PowerPanel.objects.all(),
|
|
queryset=PowerPanel.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -607,11 +589,10 @@ class PowerPanelBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['location']
|
|
|
|
|
|
|
+ nullable_fields = ('location',)
|
|
|
|
|
|
|
|
|
|
|
|
|
-class PowerFeedBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class PowerFeedBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=PowerFeed.objects.all(),
|
|
queryset=PowerFeed.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -666,10 +647,7 @@ class PowerFeedBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
label='Comments'
|
|
label='Comments'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = [
|
|
|
|
|
- 'location', 'comments',
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ nullable_fields = ('location', 'comments')
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
#
|
|
@@ -691,8 +669,7 @@ class ConsolePortTemplateBulkEditForm(BulkEditForm):
|
|
|
widget=StaticSelect()
|
|
widget=StaticSelect()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('label', 'type', 'description')
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'type', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConsoleServerPortTemplateBulkEditForm(BulkEditForm):
|
|
class ConsoleServerPortTemplateBulkEditForm(BulkEditForm):
|
|
@@ -713,8 +690,7 @@ class ConsoleServerPortTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('label', 'type', 'description')
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'type', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class PowerPortTemplateBulkEditForm(BulkEditForm):
|
|
class PowerPortTemplateBulkEditForm(BulkEditForm):
|
|
@@ -745,8 +721,7 @@ class PowerPortTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('label', 'type', 'maximum_draw', 'allocated_draw', 'description')
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'type', 'maximum_draw', 'allocated_draw', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class PowerOutletTemplateBulkEditForm(BulkEditForm):
|
|
class PowerOutletTemplateBulkEditForm(BulkEditForm):
|
|
@@ -782,8 +757,7 @@ class PowerOutletTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('label', 'type', 'power_port', 'feed_leg', 'description')
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'type', 'power_port', 'feed_leg', 'description')
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|
|
|
super().__init__(*args, **kwargs)
|
|
super().__init__(*args, **kwargs)
|
|
@@ -820,8 +794,7 @@ class InterfaceTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class FrontPortTemplateBulkEditForm(BulkEditForm):
|
|
class FrontPortTemplateBulkEditForm(BulkEditForm):
|
|
@@ -845,8 +818,7 @@ class FrontPortTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('description',)
|
|
|
|
|
|
|
+ nullable_fields = ('description',)
|
|
|
|
|
|
|
|
|
|
|
|
|
class RearPortTemplateBulkEditForm(BulkEditForm):
|
|
class RearPortTemplateBulkEditForm(BulkEditForm):
|
|
@@ -870,8 +842,7 @@ class RearPortTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('description',)
|
|
|
|
|
|
|
+ nullable_fields = ('description',)
|
|
|
|
|
|
|
|
|
|
|
|
|
class ModuleBayTemplateBulkEditForm(BulkEditForm):
|
|
class ModuleBayTemplateBulkEditForm(BulkEditForm):
|
|
@@ -887,8 +858,7 @@ class ModuleBayTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('label', 'position', 'description')
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'position', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class DeviceBayTemplateBulkEditForm(BulkEditForm):
|
|
class DeviceBayTemplateBulkEditForm(BulkEditForm):
|
|
@@ -904,8 +874,7 @@ class DeviceBayTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class InventoryItemTemplateBulkEditForm(BulkEditForm):
|
|
class InventoryItemTemplateBulkEditForm(BulkEditForm):
|
|
@@ -929,8 +898,7 @@ class InventoryItemTemplateBulkEditForm(BulkEditForm):
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'role', 'manufacturer', 'part_id', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'role', 'manufacturer', 'part_id', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
#
|
|
@@ -939,8 +907,7 @@ class InventoryItemTemplateBulkEditForm(BulkEditForm):
|
|
|
|
|
|
|
|
class ConsolePortBulkEditForm(
|
|
class ConsolePortBulkEditForm(
|
|
|
form_from_model(ConsolePort, ['label', 'type', 'speed', 'mark_connected', 'description']),
|
|
form_from_model(ConsolePort, ['label', 'type', 'speed', 'mark_connected', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=ConsolePort.objects.all(),
|
|
queryset=ConsolePort.objects.all(),
|
|
@@ -951,14 +918,12 @@ class ConsolePortBulkEditForm(
|
|
|
widget=BulkEditNullBooleanSelect
|
|
widget=BulkEditNullBooleanSelect
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConsoleServerPortBulkEditForm(
|
|
class ConsoleServerPortBulkEditForm(
|
|
|
form_from_model(ConsoleServerPort, ['label', 'type', 'speed', 'mark_connected', 'description']),
|
|
form_from_model(ConsoleServerPort, ['label', 'type', 'speed', 'mark_connected', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=ConsoleServerPort.objects.all(),
|
|
queryset=ConsoleServerPort.objects.all(),
|
|
@@ -969,14 +934,12 @@ class ConsoleServerPortBulkEditForm(
|
|
|
widget=BulkEditNullBooleanSelect
|
|
widget=BulkEditNullBooleanSelect
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class PowerPortBulkEditForm(
|
|
class PowerPortBulkEditForm(
|
|
|
form_from_model(PowerPort, ['label', 'type', 'maximum_draw', 'allocated_draw', 'mark_connected', 'description']),
|
|
form_from_model(PowerPort, ['label', 'type', 'maximum_draw', 'allocated_draw', 'mark_connected', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=PowerPort.objects.all(),
|
|
queryset=PowerPort.objects.all(),
|
|
@@ -987,14 +950,12 @@ class PowerPortBulkEditForm(
|
|
|
widget=BulkEditNullBooleanSelect
|
|
widget=BulkEditNullBooleanSelect
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class PowerOutletBulkEditForm(
|
|
class PowerOutletBulkEditForm(
|
|
|
form_from_model(PowerOutlet, ['label', 'type', 'feed_leg', 'power_port', 'mark_connected', 'description']),
|
|
form_from_model(PowerOutlet, ['label', 'type', 'feed_leg', 'power_port', 'mark_connected', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=PowerOutlet.objects.all(),
|
|
queryset=PowerOutlet.objects.all(),
|
|
@@ -1011,8 +972,7 @@ class PowerOutletBulkEditForm(
|
|
|
widget=BulkEditNullBooleanSelect
|
|
widget=BulkEditNullBooleanSelect
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'type', 'feed_leg', 'power_port', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'type', 'feed_leg', 'power_port', 'description')
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|
|
|
super().__init__(*args, **kwargs)
|
|
super().__init__(*args, **kwargs)
|
|
@@ -1031,8 +991,7 @@ class InterfaceBulkEditForm(
|
|
|
'label', 'type', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'mtu', 'mgmt_only', 'mark_connected',
|
|
'label', 'type', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'mtu', 'mgmt_only', 'mark_connected',
|
|
|
'description', 'mode', 'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power',
|
|
'description', 'mode', 'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power',
|
|
|
]),
|
|
]),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=Interface.objects.all(),
|
|
queryset=Interface.objects.all(),
|
|
@@ -1092,11 +1051,10 @@ class InterfaceBulkEditForm(
|
|
|
label='VRF'
|
|
label='VRF'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = [
|
|
|
|
|
- 'label', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'mtu', 'description', 'mode', 'rf_channel',
|
|
|
|
|
- 'rf_channel_frequency', 'rf_channel_width', 'tx_power', 'untagged_vlan', 'tagged_vlans', 'vrf',
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ nullable_fields = (
|
|
|
|
|
+ 'label', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'mtu', 'description', 'mode',
|
|
|
|
|
+ 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power', 'untagged_vlan', 'tagged_vlans', 'vrf',
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|
|
|
super().__init__(*args, **kwargs)
|
|
super().__init__(*args, **kwargs)
|
|
@@ -1154,64 +1112,55 @@ class InterfaceBulkEditForm(
|
|
|
|
|
|
|
|
class FrontPortBulkEditForm(
|
|
class FrontPortBulkEditForm(
|
|
|
form_from_model(FrontPort, ['label', 'type', 'color', 'mark_connected', 'description']),
|
|
form_from_model(FrontPort, ['label', 'type', 'color', 'mark_connected', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=FrontPort.objects.all(),
|
|
queryset=FrontPort.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class RearPortBulkEditForm(
|
|
class RearPortBulkEditForm(
|
|
|
form_from_model(RearPort, ['label', 'type', 'color', 'mark_connected', 'description']),
|
|
form_from_model(RearPort, ['label', 'type', 'color', 'mark_connected', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=RearPort.objects.all(),
|
|
queryset=RearPort.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class ModuleBayBulkEditForm(
|
|
class ModuleBayBulkEditForm(
|
|
|
form_from_model(DeviceBay, ['label', 'description']),
|
|
form_from_model(DeviceBay, ['label', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=ModuleBay.objects.all(),
|
|
queryset=ModuleBay.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'position', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'position', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class DeviceBayBulkEditForm(
|
|
class DeviceBayBulkEditForm(
|
|
|
form_from_model(DeviceBay, ['label', 'description']),
|
|
form_from_model(DeviceBay, ['label', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=DeviceBay.objects.all(),
|
|
queryset=DeviceBay.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput()
|
|
widget=forms.MultipleHiddenInput()
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
class InventoryItemBulkEditForm(
|
|
class InventoryItemBulkEditForm(
|
|
|
form_from_model(InventoryItem, ['label', 'role', 'manufacturer', 'part_id', 'description']),
|
|
form_from_model(InventoryItem, ['label', 'role', 'manufacturer', 'part_id', 'description']),
|
|
|
- AddRemoveTagsForm,
|
|
|
|
|
- CustomFieldModelBulkEditForm
|
|
|
|
|
|
|
+ NetBoxModelBulkEditForm
|
|
|
):
|
|
):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=InventoryItem.objects.all(),
|
|
queryset=InventoryItem.objects.all(),
|
|
@@ -1226,15 +1175,14 @@ class InventoryItemBulkEditForm(
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['label', 'role', 'manufacturer', 'part_id', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('label', 'role', 'manufacturer', 'part_id', 'description')
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
#
|
|
|
# Device component roles
|
|
# Device component roles
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class InventoryItemRoleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditForm):
|
|
|
|
|
|
|
+class InventoryItemRoleBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
pk = forms.ModelMultipleChoiceField(
|
|
pk = forms.ModelMultipleChoiceField(
|
|
|
queryset=InventoryItemRole.objects.all(),
|
|
queryset=InventoryItemRole.objects.all(),
|
|
|
widget=forms.MultipleHiddenInput
|
|
widget=forms.MultipleHiddenInput
|
|
@@ -1247,5 +1195,4 @@ class InventoryItemRoleBulkEditForm(AddRemoveTagsForm, CustomFieldModelBulkEditF
|
|
|
required=False
|
|
required=False
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- class Meta:
|
|
|
|
|
- nullable_fields = ['color', 'description']
|
|
|
|
|
|
|
+ nullable_fields = ('color', 'description')
|