mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Remove StaticSelect, StaticSelectMultiple form widgets * Tag custom ChoiceField, MultipleChoiceField classes for removal in v3.6
This commit is contained in:
committed by
jeremystretch
parent
c73829fe92
commit
b9bd96f0c7
@@ -11,7 +11,7 @@ from netbox.forms import NetBoxModelBulkEditForm
|
||||
from tenancy.models import Tenant
|
||||
from utilities.forms import (
|
||||
add_blank_choice, BulkEditForm, BulkEditNullBooleanSelect, ColorField, CommentField, DynamicModelChoiceField,
|
||||
DynamicModelMultipleChoiceField, form_from_model, StaticSelect, SelectSpeedWidget,
|
||||
DynamicModelMultipleChoiceField, form_from_model, SelectSpeedWidget,
|
||||
)
|
||||
|
||||
__all__ = (
|
||||
@@ -96,8 +96,7 @@ class SiteBulkEditForm(NetBoxModelBulkEditForm):
|
||||
status = forms.ChoiceField(
|
||||
choices=add_blank_choice(SiteStatusChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
region = DynamicModelChoiceField(
|
||||
queryset=Region.objects.all(),
|
||||
@@ -130,8 +129,7 @@ class SiteBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
time_zone = TimeZoneFormField(
|
||||
choices=add_blank_choice(TimeZoneFormField().choices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
@@ -166,8 +164,7 @@ class LocationBulkEditForm(NetBoxModelBulkEditForm):
|
||||
status = forms.ChoiceField(
|
||||
choices=add_blank_choice(LocationStatusChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
tenant = DynamicModelChoiceField(
|
||||
queryset=Tenant.objects.all(),
|
||||
@@ -238,8 +235,7 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
|
||||
status = forms.ChoiceField(
|
||||
choices=add_blank_choice(RackStatusChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
role = DynamicModelChoiceField(
|
||||
queryset=RackRole.objects.all(),
|
||||
@@ -256,13 +252,11 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(RackTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
width = forms.ChoiceField(
|
||||
choices=add_blank_choice(RackWidthChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
u_height = forms.IntegerField(
|
||||
required=False,
|
||||
@@ -283,8 +277,7 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
outer_unit = forms.ChoiceField(
|
||||
choices=add_blank_choice(RackDimensionUnitChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
mounting_depth = forms.IntegerField(
|
||||
required=False,
|
||||
@@ -301,8 +294,7 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
|
||||
weight_unit = forms.ChoiceField(
|
||||
choices=add_blank_choice(WeightUnitChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
@@ -333,8 +325,7 @@ class RackReservationBulkEditForm(NetBoxModelBulkEditForm):
|
||||
queryset=User.objects.order_by(
|
||||
'username'
|
||||
),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
tenant = DynamicModelChoiceField(
|
||||
queryset=Tenant.objects.all(),
|
||||
@@ -392,8 +383,7 @@ class DeviceTypeBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
airflow = forms.ChoiceField(
|
||||
choices=add_blank_choice(DeviceAirflowChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
weight = forms.DecimalField(
|
||||
min_value=0,
|
||||
@@ -402,8 +392,7 @@ class DeviceTypeBulkEditForm(NetBoxModelBulkEditForm):
|
||||
weight_unit = forms.ChoiceField(
|
||||
choices=add_blank_choice(WeightUnitChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
@@ -437,8 +426,7 @@ class ModuleTypeBulkEditForm(NetBoxModelBulkEditForm):
|
||||
weight_unit = forms.ChoiceField(
|
||||
choices=add_blank_choice(WeightUnitChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
@@ -537,13 +525,11 @@ class DeviceBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
status = forms.ChoiceField(
|
||||
choices=add_blank_choice(DeviceStatusChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
airflow = forms.ChoiceField(
|
||||
choices=add_blank_choice(DeviceAirflowChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
serial = forms.CharField(
|
||||
max_length=50,
|
||||
@@ -585,8 +571,7 @@ class ModuleBulkEditForm(NetBoxModelBulkEditForm):
|
||||
status = forms.ChoiceField(
|
||||
choices=add_blank_choice(ModuleStatusChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
serial = forms.CharField(
|
||||
max_length=50,
|
||||
@@ -613,13 +598,11 @@ class CableBulkEditForm(NetBoxModelBulkEditForm):
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(CableTypeChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
status = forms.ChoiceField(
|
||||
choices=add_blank_choice(LinkStatusChoices),
|
||||
required=False,
|
||||
widget=StaticSelect(),
|
||||
initial=''
|
||||
)
|
||||
tenant = DynamicModelChoiceField(
|
||||
@@ -640,8 +623,7 @@ class CableBulkEditForm(NetBoxModelBulkEditForm):
|
||||
length_unit = forms.ChoiceField(
|
||||
choices=add_blank_choice(CableLengthUnitChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
@@ -741,26 +723,22 @@ class PowerFeedBulkEditForm(NetBoxModelBulkEditForm):
|
||||
status = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerFeedStatusChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerFeedTypeChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
supply = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerFeedSupplyChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
phase = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerFeedPhaseChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
voltage = forms.IntegerField(
|
||||
required=False
|
||||
@@ -807,8 +785,7 @@ class ConsolePortTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(ConsolePortTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
|
||||
nullable_fields = ('label', 'type', 'description')
|
||||
@@ -825,8 +802,7 @@ class ConsoleServerPortTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(ConsolePortTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
description = forms.CharField(
|
||||
required=False
|
||||
@@ -846,8 +822,7 @@ class PowerPortTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerPortTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
maximum_draw = forms.IntegerField(
|
||||
min_value=1,
|
||||
@@ -883,8 +858,7 @@ class PowerOutletTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerOutletTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
power_port = forms.ModelChoiceField(
|
||||
queryset=PowerPortTemplate.objects.all(),
|
||||
@@ -892,8 +866,7 @@ class PowerOutletTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
feed_leg = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerOutletFeedLegChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
description = forms.CharField(
|
||||
required=False
|
||||
@@ -924,8 +897,7 @@ class InterfaceTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(InterfaceTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
enabled = forms.NullBooleanField(
|
||||
required=False,
|
||||
@@ -943,14 +915,12 @@ class InterfaceTemplateBulkEditForm(BulkEditForm):
|
||||
choices=add_blank_choice(InterfacePoEModeChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect(),
|
||||
label=_('PoE mode')
|
||||
)
|
||||
poe_type = forms.ChoiceField(
|
||||
choices=add_blank_choice(InterfacePoETypeChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect(),
|
||||
label=_('PoE type')
|
||||
)
|
||||
|
||||
@@ -968,8 +938,7 @@ class FrontPortTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(PortTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
color = ColorField(
|
||||
required=False
|
||||
@@ -992,8 +961,7 @@ class RearPortTemplateBulkEditForm(BulkEditForm):
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(PortTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
color = ColorField(
|
||||
required=False
|
||||
@@ -1208,14 +1176,12 @@ class InterfaceBulkEditForm(
|
||||
choices=add_blank_choice(InterfacePoEModeChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect(),
|
||||
label=_('PoE mode')
|
||||
)
|
||||
poe_type = forms.ChoiceField(
|
||||
choices=add_blank_choice(InterfacePoETypeChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect(),
|
||||
label=_('PoE type')
|
||||
)
|
||||
mark_connected = forms.NullBooleanField(
|
||||
@@ -1225,8 +1191,7 @@ class InterfaceBulkEditForm(
|
||||
mode = forms.ChoiceField(
|
||||
choices=add_blank_choice(InterfaceModeChoices),
|
||||
required=False,
|
||||
initial='',
|
||||
widget=StaticSelect()
|
||||
initial=''
|
||||
)
|
||||
vlan_group = DynamicModelChoiceField(
|
||||
queryset=VLANGroup.objects.all(),
|
||||
@@ -1426,8 +1391,7 @@ class VirtualDeviceContextBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
status = forms.ChoiceField(
|
||||
required=False,
|
||||
choices=add_blank_choice(VirtualDeviceContextStatusChoices),
|
||||
widget=StaticSelect()
|
||||
choices=add_blank_choice(VirtualDeviceContextStatusChoices)
|
||||
)
|
||||
tenant = DynamicModelChoiceField(
|
||||
queryset=Tenant.objects.all(),
|
||||
|
||||
@@ -10,8 +10,8 @@ from ipam.models import ASN, L2VPN, VRF
|
||||
from netbox.forms import NetBoxModelFilterSetForm
|
||||
from tenancy.forms import ContactModelFilterForm, TenancyFilterForm
|
||||
from utilities.forms import (
|
||||
APISelectMultiple, add_blank_choice, ColorField, DynamicModelMultipleChoiceField, FilterForm, MultipleChoiceField,
|
||||
StaticSelect, TagFilterField, BOOLEAN_WITH_BLANK_CHOICES, SelectSpeedWidget,
|
||||
APISelectMultiple, add_blank_choice, ColorField, DynamicModelMultipleChoiceField, FilterForm,
|
||||
TagFilterField, BOOLEAN_WITH_BLANK_CHOICES, SelectSpeedWidget,
|
||||
)
|
||||
from wireless.choices import *
|
||||
|
||||
@@ -150,7 +150,7 @@ class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
||||
('Tenant', ('tenant_group_id', 'tenant_id')),
|
||||
('Contacts', ('contact', 'contact_role', 'contact_group')),
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
choices=SiteStatusChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -208,7 +208,7 @@ class LocationFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelF
|
||||
},
|
||||
label=_('Parent')
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
choices=LocationStatusChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -258,15 +258,15 @@ class RackFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilte
|
||||
},
|
||||
label=_('Location')
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
choices=RackStatusChoices,
|
||||
required=False
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=RackTypeChoices,
|
||||
required=False
|
||||
)
|
||||
width = MultipleChoiceField(
|
||||
width = forms.MultipleChoiceField(
|
||||
choices=RackWidthChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -399,88 +399,88 @@ class DeviceTypeFilterForm(NetBoxModelFilterSetForm):
|
||||
part_number = forms.CharField(
|
||||
required=False
|
||||
)
|
||||
subdevice_role = MultipleChoiceField(
|
||||
subdevice_role = forms.MultipleChoiceField(
|
||||
choices=add_blank_choice(SubdeviceRoleChoices),
|
||||
required=False
|
||||
)
|
||||
airflow = MultipleChoiceField(
|
||||
airflow = forms.MultipleChoiceField(
|
||||
choices=add_blank_choice(DeviceAirflowChoices),
|
||||
required=False
|
||||
)
|
||||
has_front_image = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has a front image',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
has_rear_image = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has a rear image',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
console_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has console ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
console_server_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has console server ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
power_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has power ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
power_outlets = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has power outlets',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
interfaces = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has interfaces',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
pass_through_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has pass-through ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
device_bays = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has device bays',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
module_bays = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has module bays',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
inventory_items = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has inventory items',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
@@ -517,42 +517,42 @@ class ModuleTypeFilterForm(NetBoxModelFilterSetForm):
|
||||
console_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has console ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
console_server_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has console server ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
power_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has power ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
power_outlets = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has power outlets',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
interfaces = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has interfaces',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
pass_through_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has pass-through ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
@@ -662,11 +662,11 @@ class DeviceFilterForm(
|
||||
null_option='None',
|
||||
label=_('Platform')
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
choices=DeviceStatusChoices,
|
||||
required=False
|
||||
)
|
||||
airflow = MultipleChoiceField(
|
||||
airflow = forms.MultipleChoiceField(
|
||||
choices=add_blank_choice(DeviceAirflowChoices),
|
||||
required=False
|
||||
)
|
||||
@@ -683,56 +683,56 @@ class DeviceFilterForm(
|
||||
has_primary_ip = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has a primary IP',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
virtual_chassis_member = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Virtual chassis member',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
console_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has console ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
console_server_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has console server ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
power_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has power ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
power_outlets = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has power outlets',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
interfaces = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has interfaces',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
pass_through_ports = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has pass-through ports',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
@@ -755,14 +755,14 @@ class VirtualDeviceContextFilterForm(
|
||||
label=_('Device'),
|
||||
fetch_trigger='open'
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
required=False,
|
||||
choices=add_blank_choice(VirtualDeviceContextStatusChoices)
|
||||
)
|
||||
has_primary_ip = forms.NullBooleanField(
|
||||
required=False,
|
||||
label='Has a primary IP',
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
@@ -790,7 +790,7 @@ class ModuleFilterForm(LocalConfigContextFilterForm, TenancyFilterForm, NetBoxMo
|
||||
label=_('Type'),
|
||||
fetch_trigger='open'
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
choices=ModuleStatusChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -883,11 +883,11 @@ class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
|
||||
},
|
||||
label=_('Device')
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=add_blank_choice(CableTypeChoices),
|
||||
required=False
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
required=False,
|
||||
choices=add_blank_choice(LinkStatusChoices)
|
||||
)
|
||||
@@ -985,24 +985,21 @@ class PowerFeedFilterForm(NetBoxModelFilterSetForm):
|
||||
},
|
||||
label=_('Rack')
|
||||
)
|
||||
status = MultipleChoiceField(
|
||||
status = forms.MultipleChoiceField(
|
||||
choices=PowerFeedStatusChoices,
|
||||
required=False
|
||||
)
|
||||
type = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerFeedTypeChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
supply = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerFeedSupplyChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
phase = forms.ChoiceField(
|
||||
choices=add_blank_choice(PowerFeedPhaseChoices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
voltage = forms.IntegerField(
|
||||
required=False
|
||||
@@ -1023,13 +1020,13 @@ class PowerFeedFilterForm(NetBoxModelFilterSetForm):
|
||||
class CabledFilterForm(forms.Form):
|
||||
cabled = forms.NullBooleanField(
|
||||
required=False,
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
occupied = forms.NullBooleanField(
|
||||
required=False,
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
@@ -1038,7 +1035,7 @@ class CabledFilterForm(forms.Form):
|
||||
class PathEndpointFilterForm(CabledFilterForm):
|
||||
connected = forms.NullBooleanField(
|
||||
required=False,
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
@@ -1052,11 +1049,11 @@ class ConsolePortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
('Device', ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', 'virtual_chassis_id', 'device_id')),
|
||||
('Connection', ('cabled', 'connected', 'occupied')),
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=ConsolePortTypeChoices,
|
||||
required=False
|
||||
)
|
||||
speed = MultipleChoiceField(
|
||||
speed = forms.MultipleChoiceField(
|
||||
choices=ConsolePortSpeedChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -1071,11 +1068,11 @@ class ConsoleServerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterF
|
||||
('Device', ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', 'virtual_chassis_id', 'device_id')),
|
||||
('Connection', ('cabled', 'connected', 'occupied')),
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=ConsolePortTypeChoices,
|
||||
required=False
|
||||
)
|
||||
speed = MultipleChoiceField(
|
||||
speed = forms.MultipleChoiceField(
|
||||
choices=ConsolePortSpeedChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -1090,7 +1087,7 @@ class PowerPortFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
('Device', ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', 'virtual_chassis_id', 'device_id')),
|
||||
('Connection', ('cabled', 'connected', 'occupied')),
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=PowerPortTypeChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -1105,7 +1102,7 @@ class PowerOutletFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
('Device', ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', 'virtual_chassis_id', 'device_id')),
|
||||
('Connection', ('cabled', 'connected', 'occupied')),
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=PowerOutletTypeChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -1132,11 +1129,11 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
},
|
||||
label=_('Virtual Device Context')
|
||||
)
|
||||
kind = MultipleChoiceField(
|
||||
kind = forms.MultipleChoiceField(
|
||||
choices=InterfaceKindChoices,
|
||||
required=False
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=InterfaceTypeChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -1145,19 +1142,19 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
label='Speed',
|
||||
widget=SelectSpeedWidget()
|
||||
)
|
||||
duplex = MultipleChoiceField(
|
||||
duplex = forms.MultipleChoiceField(
|
||||
choices=InterfaceDuplexChoices,
|
||||
required=False
|
||||
)
|
||||
enabled = forms.NullBooleanField(
|
||||
required=False,
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
mgmt_only = forms.NullBooleanField(
|
||||
required=False,
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
@@ -1169,22 +1166,22 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm):
|
||||
required=False,
|
||||
label='WWN'
|
||||
)
|
||||
poe_mode = MultipleChoiceField(
|
||||
poe_mode = forms.MultipleChoiceField(
|
||||
choices=InterfacePoEModeChoices,
|
||||
required=False,
|
||||
label='PoE mode'
|
||||
)
|
||||
poe_type = MultipleChoiceField(
|
||||
poe_type = forms.MultipleChoiceField(
|
||||
choices=InterfacePoETypeChoices,
|
||||
required=False,
|
||||
label='PoE type'
|
||||
)
|
||||
rf_role = MultipleChoiceField(
|
||||
rf_role = forms.MultipleChoiceField(
|
||||
choices=WirelessRoleChoices,
|
||||
required=False,
|
||||
label='Wireless role'
|
||||
)
|
||||
rf_channel = MultipleChoiceField(
|
||||
rf_channel = forms.MultipleChoiceField(
|
||||
choices=WirelessChannelChoices,
|
||||
required=False,
|
||||
label='Wireless channel'
|
||||
@@ -1224,7 +1221,7 @@ class FrontPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
||||
('Cable', ('cabled', 'occupied')),
|
||||
)
|
||||
model = FrontPort
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=PortTypeChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -1242,7 +1239,7 @@ class RearPortFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
||||
('Device', ('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', 'virtual_chassis_id', 'device_id')),
|
||||
('Cable', ('cabled', 'occupied')),
|
||||
)
|
||||
type = MultipleChoiceField(
|
||||
type = forms.MultipleChoiceField(
|
||||
choices=PortTypeChoices,
|
||||
required=False
|
||||
)
|
||||
@@ -1301,7 +1298,7 @@ class InventoryItemFilterForm(DeviceComponentFilterForm):
|
||||
)
|
||||
discovered = forms.NullBooleanField(
|
||||
required=False,
|
||||
widget=StaticSelect(
|
||||
widget=forms.Select(
|
||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||
)
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ from tenancy.forms import TenancyForm
|
||||
from utilities.forms import (
|
||||
APISelect, add_blank_choice, BootstrapMixin, ClearableFileInput, CommentField, ContentTypeChoiceField,
|
||||
DynamicModelChoiceField, DynamicModelMultipleChoiceField, JSONField, NumericArrayField, SelectWithPK,
|
||||
SlugField, StaticSelect, SelectSpeedWidget,
|
||||
SlugField, SelectSpeedWidget,
|
||||
)
|
||||
from virtualization.models import Cluster, ClusterGroup
|
||||
from wireless.models import WirelessLAN, WirelessLANGroup
|
||||
@@ -129,8 +129,7 @@ class SiteForm(TenancyForm, NetBoxModelForm):
|
||||
slug = SlugField()
|
||||
time_zone = TimeZoneFormField(
|
||||
choices=add_blank_choice(TimeZoneFormField().choices),
|
||||
required=False,
|
||||
widget=StaticSelect()
|
||||
required=False
|
||||
)
|
||||
comments = CommentField()
|
||||
|
||||
@@ -159,8 +158,6 @@ class SiteForm(TenancyForm, NetBoxModelForm):
|
||||
'rows': 3,
|
||||
}
|
||||
),
|
||||
'status': StaticSelect(),
|
||||
'time_zone': StaticSelect(),
|
||||
}
|
||||
help_texts = {
|
||||
'name': _("Full name of the site"),
|
||||
@@ -218,9 +215,6 @@ class LocationForm(TenancyForm, NetBoxModelForm):
|
||||
'region', 'site_group', 'site', 'parent', 'name', 'slug', 'status', 'description', 'tenant_group', 'tenant',
|
||||
'tags',
|
||||
)
|
||||
widgets = {
|
||||
'status': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class RackRoleForm(NetBoxModelForm):
|
||||
@@ -287,13 +281,6 @@ class RackForm(TenancyForm, NetBoxModelForm):
|
||||
'facility_id': _("The unique rack ID assigned by the facility"),
|
||||
'u_height': _("Height in rack units"),
|
||||
}
|
||||
widgets = {
|
||||
'status': StaticSelect(),
|
||||
'type': StaticSelect(),
|
||||
'width': StaticSelect(),
|
||||
'outer_unit': StaticSelect(),
|
||||
'weight_unit': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class RackReservationForm(TenancyForm, NetBoxModelForm):
|
||||
@@ -340,8 +327,7 @@ class RackReservationForm(TenancyForm, NetBoxModelForm):
|
||||
user = forms.ModelChoiceField(
|
||||
queryset=User.objects.order_by(
|
||||
'username'
|
||||
),
|
||||
widget=StaticSelect()
|
||||
)
|
||||
)
|
||||
comments = CommentField()
|
||||
|
||||
@@ -402,15 +388,12 @@ class DeviceTypeForm(NetBoxModelForm):
|
||||
'weight', 'weight_unit', 'front_image', 'rear_image', 'description', 'comments', 'tags', 'default_platform'
|
||||
]
|
||||
widgets = {
|
||||
'airflow': StaticSelect(),
|
||||
'subdevice_role': StaticSelect(),
|
||||
'front_image': ClearableFileInput(attrs={
|
||||
'accept': DEVICETYPE_IMAGE_FORMATS
|
||||
}),
|
||||
'rear_image': ClearableFileInput(attrs={
|
||||
'accept': DEVICETYPE_IMAGE_FORMATS
|
||||
}),
|
||||
'weight_unit': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
@@ -431,10 +414,6 @@ class ModuleTypeForm(NetBoxModelForm):
|
||||
'manufacturer', 'model', 'part_number', 'weight', 'weight_unit', 'description', 'comments', 'tags',
|
||||
]
|
||||
|
||||
widgets = {
|
||||
'weight_unit': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class DeviceRoleForm(NetBoxModelForm):
|
||||
slug = SlugField()
|
||||
@@ -601,13 +580,6 @@ class DeviceForm(TenancyForm, NetBoxModelForm):
|
||||
'local_context_data': _("Local config context data overwrites all source contexts in the final rendered "
|
||||
"config context"),
|
||||
}
|
||||
widgets = {
|
||||
'face': StaticSelect(),
|
||||
'status': StaticSelect(),
|
||||
'airflow': StaticSelect(),
|
||||
'primary_ip4': StaticSelect(),
|
||||
'primary_ip6': StaticSelect(),
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
@@ -741,11 +713,6 @@ class CableForm(TenancyForm, NetBoxModelForm):
|
||||
'type', 'status', 'tenant_group', 'tenant', 'label', 'color', 'length', 'length_unit', 'description',
|
||||
'comments', 'tags',
|
||||
]
|
||||
widgets = {
|
||||
'status': StaticSelect,
|
||||
'type': StaticSelect,
|
||||
'length_unit': StaticSelect,
|
||||
}
|
||||
error_messages = {
|
||||
'length': {
|
||||
'max_value': 'Maximum length is 32767 (any unit)'
|
||||
@@ -860,12 +827,6 @@ class PowerFeedForm(NetBoxModelForm):
|
||||
'mark_connected', 'supply', 'phase', 'voltage', 'amperage', 'max_utilization', 'description', 'comments',
|
||||
'tags',
|
||||
]
|
||||
widgets = {
|
||||
'status': StaticSelect(),
|
||||
'type': StaticSelect(),
|
||||
'supply': StaticSelect(),
|
||||
'phase': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
@@ -1029,9 +990,6 @@ class ConsolePortTemplateForm(ModularComponentTemplateForm):
|
||||
fields = [
|
||||
'device_type', 'module_type', 'name', 'label', 'type', 'description',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect,
|
||||
}
|
||||
|
||||
|
||||
class ConsoleServerPortTemplateForm(ModularComponentTemplateForm):
|
||||
@@ -1044,9 +1002,6 @@ class ConsoleServerPortTemplateForm(ModularComponentTemplateForm):
|
||||
fields = [
|
||||
'device_type', 'module_type', 'name', 'label', 'type', 'description',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect,
|
||||
}
|
||||
|
||||
|
||||
class PowerPortTemplateForm(ModularComponentTemplateForm):
|
||||
@@ -1061,9 +1016,6 @@ class PowerPortTemplateForm(ModularComponentTemplateForm):
|
||||
fields = [
|
||||
'device_type', 'module_type', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class PowerOutletTemplateForm(ModularComponentTemplateForm):
|
||||
@@ -1084,10 +1036,6 @@ class PowerOutletTemplateForm(ModularComponentTemplateForm):
|
||||
fields = [
|
||||
'device_type', 'module_type', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
'feed_leg': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class InterfaceTemplateForm(ModularComponentTemplateForm):
|
||||
@@ -1101,11 +1049,6 @@ class InterfaceTemplateForm(ModularComponentTemplateForm):
|
||||
fields = [
|
||||
'device_type', 'module_type', 'name', 'label', 'type', 'mgmt_only', 'enabled', 'description', 'poe_mode', 'poe_type',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
'poe_mode': StaticSelect(),
|
||||
'poe_type': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class FrontPortTemplateForm(ModularComponentTemplateForm):
|
||||
@@ -1131,9 +1074,6 @@ class FrontPortTemplateForm(ModularComponentTemplateForm):
|
||||
'device_type', 'module_type', 'name', 'label', 'type', 'color', 'rear_port', 'rear_port_position',
|
||||
'description',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class RearPortTemplateForm(ModularComponentTemplateForm):
|
||||
@@ -1146,9 +1086,6 @@ class RearPortTemplateForm(ModularComponentTemplateForm):
|
||||
fields = [
|
||||
'device_type', 'module_type', 'name', 'label', 'type', 'color', 'positions', 'description',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class ModuleBayTemplateForm(ComponentTemplateForm):
|
||||
@@ -1256,10 +1193,6 @@ class ConsolePortForm(ModularDeviceComponentForm):
|
||||
fields = [
|
||||
'device', 'module', 'name', 'label', 'type', 'speed', 'mark_connected', 'description', 'tags',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
'speed': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class ConsoleServerPortForm(ModularDeviceComponentForm):
|
||||
@@ -1275,10 +1208,6 @@ class ConsoleServerPortForm(ModularDeviceComponentForm):
|
||||
fields = [
|
||||
'device', 'module', 'name', 'label', 'type', 'speed', 'mark_connected', 'description', 'tags',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
'speed': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class PowerPortForm(ModularDeviceComponentForm):
|
||||
@@ -1296,9 +1225,6 @@ class PowerPortForm(ModularDeviceComponentForm):
|
||||
'device', 'module', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'mark_connected',
|
||||
'description', 'tags',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class PowerOutletForm(ModularDeviceComponentForm):
|
||||
@@ -1323,10 +1249,6 @@ class PowerOutletForm(ModularDeviceComponentForm):
|
||||
'device', 'module', 'name', 'label', 'type', 'power_port', 'feed_leg', 'mark_connected', 'description',
|
||||
'tags',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
'feed_leg': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class InterfaceForm(InterfaceCommonForm, ModularDeviceComponentForm):
|
||||
@@ -1431,14 +1353,7 @@ class InterfaceForm(InterfaceCommonForm, ModularDeviceComponentForm):
|
||||
'untagged_vlan', 'tagged_vlans', 'vrf', 'tags',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
'speed': SelectSpeedWidget(),
|
||||
'poe_mode': StaticSelect(),
|
||||
'poe_type': StaticSelect(),
|
||||
'duplex': StaticSelect(),
|
||||
'mode': StaticSelect(),
|
||||
'rf_role': StaticSelect(),
|
||||
'rf_channel': StaticSelect(),
|
||||
}
|
||||
labels = {
|
||||
'mode': '802.1Q Mode',
|
||||
@@ -1471,9 +1386,6 @@ class FrontPortForm(ModularDeviceComponentForm):
|
||||
'device', 'module', 'name', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'mark_connected',
|
||||
'description', 'tags',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class RearPortForm(ModularDeviceComponentForm):
|
||||
@@ -1488,9 +1400,6 @@ class RearPortForm(ModularDeviceComponentForm):
|
||||
fields = [
|
||||
'device', 'module', 'name', 'label', 'type', 'color', 'positions', 'mark_connected', 'description', 'tags',
|
||||
]
|
||||
widgets = {
|
||||
'type': StaticSelect(),
|
||||
}
|
||||
|
||||
|
||||
class ModuleBayForm(DeviceComponentForm):
|
||||
@@ -1521,8 +1430,7 @@ class PopulateDeviceBayForm(BootstrapMixin, forms.Form):
|
||||
installed_device = forms.ModelChoiceField(
|
||||
queryset=Device.objects.all(),
|
||||
label=_('Child Device'),
|
||||
help_text=_("Child devices must first be created and assigned to the site/rack of the parent device."),
|
||||
widget=StaticSelect(),
|
||||
help_text=_("Child devices must first be created and assigned to the site/rack of the parent device.")
|
||||
)
|
||||
|
||||
def __init__(self, device_bay, *args, **kwargs):
|
||||
@@ -1771,8 +1679,3 @@ class VirtualDeviceContextForm(TenancyForm, NetBoxModelForm):
|
||||
'region', 'site_group', 'site', 'location', 'rack', 'device', 'name', 'status', 'identifier',
|
||||
'primary_ip4', 'primary_ip6', 'tenant_group', 'tenant', 'comments', 'tags'
|
||||
]
|
||||
widgets = {
|
||||
'status': StaticSelect(),
|
||||
'primary_ip4': StaticSelect(),
|
||||
'primary_ip6': StaticSelect(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user