mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Move fieldsets out of Meta for model forms
This commit is contained in:
@ -27,15 +27,16 @@ class ProviderForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Provider', ('name', 'slug', 'asn', 'tags')),
|
||||||
|
('Support Info', ('account', 'portal_url', 'noc_contact', 'admin_contact')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Provider
|
model = Provider
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'slug', 'asn', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'comments', 'tags',
|
'name', 'slug', 'asn', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'comments', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Provider', ('name', 'slug', 'asn', 'tags')),
|
|
||||||
('Support Info', ('account', 'portal_url', 'noc_contact', 'admin_contact')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'noc_contact': SmallTextarea(
|
'noc_contact': SmallTextarea(
|
||||||
attrs={'rows': 5}
|
attrs={'rows': 5}
|
||||||
@ -63,14 +64,15 @@ class ProviderNetworkForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Provider Network', ('provider', 'name', 'service_id', 'description', 'tags')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = ProviderNetwork
|
model = ProviderNetwork
|
||||||
fields = [
|
fields = [
|
||||||
'provider', 'name', 'service_id', 'description', 'comments', 'tags',
|
'provider', 'name', 'service_id', 'description', 'comments', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Provider Network', ('provider', 'name', 'service_id', 'description', 'tags')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class CircuitTypeForm(NetBoxModelForm):
|
class CircuitTypeForm(NetBoxModelForm):
|
||||||
@ -100,16 +102,17 @@ class CircuitForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Circuit', ('provider', 'cid', 'type', 'status', 'install_date', 'commit_rate', 'description', 'tags')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Circuit
|
model = Circuit
|
||||||
fields = [
|
fields = [
|
||||||
'cid', 'type', 'provider', 'status', 'install_date', 'commit_rate', 'description', 'tenant_group', 'tenant',
|
'cid', 'type', 'provider', 'status', 'install_date', 'commit_rate', 'description', 'tenant_group', 'tenant',
|
||||||
'comments', 'tags',
|
'comments', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Circuit', ('provider', 'cid', 'type', 'status', 'install_date', 'commit_rate', 'description', 'tags')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
help_texts = {
|
help_texts = {
|
||||||
'cid': "Unique circuit ID",
|
'cid': "Unique circuit ID",
|
||||||
'commit_rate': "Committed rate",
|
'commit_rate': "Committed rate",
|
||||||
|
@ -134,12 +134,6 @@ class SiteForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = Site
|
|
||||||
fields = (
|
|
||||||
'name', 'slug', 'status', 'region', 'group', 'tenant_group', 'tenant', 'facility', 'asns', 'time_zone',
|
|
||||||
'description', 'physical_address', 'shipping_address', 'latitude', 'longitude', 'comments', 'tags',
|
|
||||||
)
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Site', (
|
('Site', (
|
||||||
'name', 'slug', 'status', 'region', 'group', 'facility', 'asns', 'time_zone', 'description', 'tags',
|
'name', 'slug', 'status', 'region', 'group', 'facility', 'asns', 'time_zone', 'description', 'tags',
|
||||||
@ -147,6 +141,13 @@ class SiteForm(TenancyForm, NetBoxModelForm):
|
|||||||
('Tenancy', ('tenant_group', 'tenant')),
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
('Contact Info', ('physical_address', 'shipping_address', 'latitude', 'longitude')),
|
('Contact Info', ('physical_address', 'shipping_address', 'latitude', 'longitude')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Site
|
||||||
|
fields = (
|
||||||
|
'name', 'slug', 'status', 'region', 'group', 'tenant_group', 'tenant', 'facility', 'asns', 'time_zone',
|
||||||
|
'description', 'physical_address', 'shipping_address', 'latitude', 'longitude', 'comments', 'tags',
|
||||||
|
)
|
||||||
widgets = {
|
widgets = {
|
||||||
'physical_address': SmallTextarea(
|
'physical_address': SmallTextarea(
|
||||||
attrs={
|
attrs={
|
||||||
@ -208,11 +209,6 @@ class LocationForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = Location
|
|
||||||
fields = (
|
|
||||||
'region', 'site_group', 'site', 'parent', 'name', 'slug', 'description', 'tenant_group', 'tenant', 'tags',
|
|
||||||
)
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Location', (
|
('Location', (
|
||||||
'region', 'site_group', 'site', 'parent', 'name', 'slug', 'description', 'tags',
|
'region', 'site_group', 'site', 'parent', 'name', 'slug', 'description', 'tags',
|
||||||
@ -220,6 +216,12 @@ class LocationForm(TenancyForm, NetBoxModelForm):
|
|||||||
('Tenancy', ('tenant_group', 'tenant')),
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Location
|
||||||
|
fields = (
|
||||||
|
'region', 'site_group', 'site', 'parent', 'name', 'slug', 'description', 'tenant_group', 'tenant', 'tags',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class RackRoleForm(NetBoxModelForm):
|
class RackRoleForm(NetBoxModelForm):
|
||||||
slug = SlugField()
|
slug = SlugField()
|
||||||
@ -347,16 +349,17 @@ class RackReservationForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Reservation', ('region', 'site', 'location', 'rack', 'units', 'user', 'description', 'tags')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = RackReservation
|
model = RackReservation
|
||||||
fields = [
|
fields = [
|
||||||
'region', 'site_group', 'site', 'location', 'rack', 'units', 'user', 'tenant_group', 'tenant',
|
'region', 'site_group', 'site', 'location', 'rack', 'units', 'user', 'tenant_group', 'tenant',
|
||||||
'description', 'tags',
|
'description', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Reservation', ('region', 'site', 'location', 'rack', 'units', 'user', 'description', 'tags')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ManufacturerForm(NetBoxModelForm):
|
class ManufacturerForm(NetBoxModelForm):
|
||||||
@ -386,12 +389,6 @@ class DeviceTypeForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = DeviceType
|
|
||||||
fields = [
|
|
||||||
'manufacturer', 'model', 'slug', 'part_number', 'u_height', 'is_full_depth', 'subdevice_role', 'airflow',
|
|
||||||
'front_image', 'rear_image', 'comments', 'tags',
|
|
||||||
]
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Device Type', (
|
('Device Type', (
|
||||||
'manufacturer', 'model', 'slug', 'part_number', 'tags',
|
'manufacturer', 'model', 'slug', 'part_number', 'tags',
|
||||||
@ -401,6 +398,13 @@ class DeviceTypeForm(NetBoxModelForm):
|
|||||||
)),
|
)),
|
||||||
('Images', ('front_image', 'rear_image')),
|
('Images', ('front_image', 'rear_image')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = DeviceType
|
||||||
|
fields = [
|
||||||
|
'manufacturer', 'model', 'slug', 'part_number', 'u_height', 'is_full_depth', 'subdevice_role', 'airflow',
|
||||||
|
'front_image', 'rear_image', 'comments', 'tags',
|
||||||
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
'subdevice_role': StaticSelect(),
|
'subdevice_role': StaticSelect(),
|
||||||
'front_image': ClearableFileInput(attrs={
|
'front_image': ClearableFileInput(attrs={
|
||||||
@ -745,14 +749,15 @@ class PowerPanelForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Power Panel', ('region', 'site_group', 'site', 'location', 'name', 'tags')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PowerPanel
|
model = PowerPanel
|
||||||
fields = [
|
fields = [
|
||||||
'region', 'site_group', 'site', 'location', 'name', 'tags',
|
'region', 'site_group', 'site', 'location', 'name', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Power Panel', ('region', 'site_group', 'site', 'location', 'name', 'tags')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class PowerFeedForm(NetBoxModelForm):
|
class PowerFeedForm(NetBoxModelForm):
|
||||||
@ -800,17 +805,18 @@ class PowerFeedForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Power Panel', ('region', 'site', 'power_panel')),
|
||||||
|
('Power Feed', ('rack', 'name', 'status', 'type', 'mark_connected', 'tags')),
|
||||||
|
('Characteristics', ('supply', 'voltage', 'amperage', 'phase', 'max_utilization')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PowerFeed
|
model = PowerFeed
|
||||||
fields = [
|
fields = [
|
||||||
'region', 'site_group', 'site', 'power_panel', 'rack', 'name', 'status', 'type', 'mark_connected', 'supply',
|
'region', 'site_group', 'site', 'power_panel', 'rack', 'name', 'status', 'type', 'mark_connected', 'supply',
|
||||||
'phase', 'voltage', 'amperage', 'max_utilization', 'comments', 'tags',
|
'phase', 'voltage', 'amperage', 'max_utilization', 'comments', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Power Panel', ('region', 'site', 'power_panel')),
|
|
||||||
('Power Feed', ('rack', 'name', 'status', 'type', 'mark_connected', 'tags')),
|
|
||||||
('Characteristics', ('supply', 'voltage', 'amperage', 'phase', 'max_utilization')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'status': StaticSelect(),
|
'status': StaticSelect(),
|
||||||
'type': StaticSelect(),
|
'type': StaticSelect(),
|
||||||
@ -1101,16 +1107,17 @@ class InventoryItemTemplateForm(BootstrapMixin, forms.ModelForm):
|
|||||||
widget=forms.HiddenInput
|
widget=forms.HiddenInput
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Inventory Item', ('device_type', 'parent', 'name', 'label', 'role', 'description')),
|
||||||
|
('Hardware', ('manufacturer', 'part_id')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = InventoryItemTemplate
|
model = InventoryItemTemplate
|
||||||
fields = [
|
fields = [
|
||||||
'device_type', 'parent', 'name', 'label', 'role', 'manufacturer', 'part_id', 'description',
|
'device_type', 'parent', 'name', 'label', 'role', 'manufacturer', 'part_id', 'description',
|
||||||
'component_type', 'component_id',
|
'component_type', 'component_id',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Inventory Item', ('device_type', 'parent', 'name', 'label', 'role', 'description')),
|
|
||||||
('Hardware', ('manufacturer', 'part_id')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'device_type': forms.HiddenInput(),
|
'device_type': forms.HiddenInput(),
|
||||||
}
|
}
|
||||||
@ -1271,13 +1278,6 @@ class InterfaceForm(InterfaceCommonForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = Interface
|
|
||||||
fields = [
|
|
||||||
'device', 'name', 'label', 'type', 'speed', 'duplex', 'enabled', 'parent', 'bridge', 'lag', 'mac_address', 'wwn', 'mtu',
|
|
||||||
'mgmt_only', 'mark_connected', 'description', 'mode', 'rf_role', 'rf_channel', 'rf_channel_frequency',
|
|
||||||
'rf_channel_width', 'tx_power', 'wireless_lans', 'untagged_vlan', 'tagged_vlans', 'vrf', 'tags',
|
|
||||||
]
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Interface', ('device', 'name', 'type', 'speed', 'duplex', 'label', 'description', 'tags')),
|
('Interface', ('device', 'name', 'type', 'speed', 'duplex', 'label', 'description', 'tags')),
|
||||||
('Addressing', ('vrf', 'mac_address', 'wwn')),
|
('Addressing', ('vrf', 'mac_address', 'wwn')),
|
||||||
@ -1285,10 +1285,17 @@ class InterfaceForm(InterfaceCommonForm, NetBoxModelForm):
|
|||||||
('Related Interfaces', ('parent', 'bridge', 'lag')),
|
('Related Interfaces', ('parent', 'bridge', 'lag')),
|
||||||
('802.1Q Switching', ('mode', 'vlan_group', 'untagged_vlan', 'tagged_vlans')),
|
('802.1Q Switching', ('mode', 'vlan_group', 'untagged_vlan', 'tagged_vlans')),
|
||||||
('Wireless', (
|
('Wireless', (
|
||||||
'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'wireless_lan_group',
|
'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'wireless_lan_group', 'wireless_lans',
|
||||||
'wireless_lans',
|
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Interface
|
||||||
|
fields = [
|
||||||
|
'device', 'name', 'label', 'type', 'speed', 'duplex', 'enabled', 'parent', 'bridge', 'lag', 'mac_address', 'wwn', 'mtu',
|
||||||
|
'mgmt_only', 'mark_connected', 'description', 'mode', 'rf_role', 'rf_channel', 'rf_channel_frequency',
|
||||||
|
'rf_channel_width', 'tx_power', 'wireless_lans', 'untagged_vlan', 'tagged_vlans', 'vrf', 'tags',
|
||||||
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
'device': forms.HiddenInput(),
|
'device': forms.HiddenInput(),
|
||||||
'type': StaticSelect(),
|
'type': StaticSelect(),
|
||||||
@ -1432,16 +1439,17 @@ class InventoryItemForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Inventory Item', ('device', 'parent', 'name', 'label', 'role', 'description', 'tags')),
|
||||||
|
('Hardware', ('manufacturer', 'part_id', 'serial', 'asset_tag')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = InventoryItem
|
model = InventoryItem
|
||||||
fields = [
|
fields = [
|
||||||
'device', 'parent', 'name', 'label', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag',
|
'device', 'parent', 'name', 'label', 'role', 'manufacturer', 'part_id', 'serial', 'asset_tag',
|
||||||
'description', 'component_type', 'component_id', 'tags',
|
'description', 'component_type', 'component_id', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Inventory Item', ('device', 'parent', 'name', 'label', 'role', 'description', 'tags')),
|
|
||||||
('Hardware', ('manufacturer', 'part_id', 'serial', 'asset_tag')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'device': forms.HiddenInput(),
|
'device': forms.HiddenInput(),
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,6 @@ class CustomFieldForm(BootstrapMixin, forms.ModelForm):
|
|||||||
limit_choices_to=FeatureQuery('custom_fields')
|
limit_choices_to=FeatureQuery('custom_fields')
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = CustomField
|
|
||||||
fields = '__all__'
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Custom Field', ('name', 'label', 'type', 'object_type', 'weight', 'required', 'description')),
|
('Custom Field', ('name', 'label', 'type', 'object_type', 'weight', 'required', 'description')),
|
||||||
('Assigned Models', ('content_types',)),
|
('Assigned Models', ('content_types',)),
|
||||||
@ -40,6 +37,10 @@ class CustomFieldForm(BootstrapMixin, forms.ModelForm):
|
|||||||
('Values', ('default', 'choices')),
|
('Values', ('default', 'choices')),
|
||||||
('Validation', ('validation_minimum', 'validation_maximum', 'validation_regex')),
|
('Validation', ('validation_minimum', 'validation_maximum', 'validation_regex')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = CustomField
|
||||||
|
fields = '__all__'
|
||||||
widgets = {
|
widgets = {
|
||||||
'type': StaticSelect(),
|
'type': StaticSelect(),
|
||||||
'filter_logic': StaticSelect(),
|
'filter_logic': StaticSelect(),
|
||||||
@ -52,13 +53,14 @@ class CustomLinkForm(BootstrapMixin, forms.ModelForm):
|
|||||||
limit_choices_to=FeatureQuery('custom_links')
|
limit_choices_to=FeatureQuery('custom_links')
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = CustomLink
|
|
||||||
fields = '__all__'
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Custom Link', ('name', 'content_type', 'weight', 'group_name', 'button_class', 'enabled', 'new_window')),
|
('Custom Link', ('name', 'content_type', 'weight', 'group_name', 'button_class', 'enabled', 'new_window')),
|
||||||
('Templates', ('link_text', 'link_url')),
|
('Templates', ('link_text', 'link_url')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = CustomLink
|
||||||
|
fields = '__all__'
|
||||||
widgets = {
|
widgets = {
|
||||||
'button_class': StaticSelect(),
|
'button_class': StaticSelect(),
|
||||||
'link_text': forms.Textarea(attrs={'class': 'font-monospace'}),
|
'link_text': forms.Textarea(attrs={'class': 'font-monospace'}),
|
||||||
@ -77,14 +79,15 @@ class ExportTemplateForm(BootstrapMixin, forms.ModelForm):
|
|||||||
limit_choices_to=FeatureQuery('export_templates')
|
limit_choices_to=FeatureQuery('export_templates')
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = ExportTemplate
|
|
||||||
fields = '__all__'
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Export Template', ('name', 'content_type', 'description')),
|
('Export Template', ('name', 'content_type', 'description')),
|
||||||
('Template', ('template_code',)),
|
('Template', ('template_code',)),
|
||||||
('Rendering', ('mime_type', 'file_extension', 'as_attachment')),
|
('Rendering', ('mime_type', 'file_extension', 'as_attachment')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = ExportTemplate
|
||||||
|
fields = '__all__'
|
||||||
widgets = {
|
widgets = {
|
||||||
'template_code': forms.Textarea(attrs={'class': 'font-monospace'}),
|
'template_code': forms.Textarea(attrs={'class': 'font-monospace'}),
|
||||||
}
|
}
|
||||||
@ -96,9 +99,6 @@ class WebhookForm(BootstrapMixin, forms.ModelForm):
|
|||||||
limit_choices_to=FeatureQuery('webhooks')
|
limit_choices_to=FeatureQuery('webhooks')
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = Webhook
|
|
||||||
fields = '__all__'
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Webhook', ('name', 'content_types', 'enabled')),
|
('Webhook', ('name', 'content_types', 'enabled')),
|
||||||
('Events', ('type_create', 'type_update', 'type_delete')),
|
('Events', ('type_create', 'type_update', 'type_delete')),
|
||||||
@ -108,6 +108,10 @@ class WebhookForm(BootstrapMixin, forms.ModelForm):
|
|||||||
('Conditions', ('conditions',)),
|
('Conditions', ('conditions',)),
|
||||||
('SSL', ('ssl_verification', 'ca_file_path')),
|
('SSL', ('ssl_verification', 'ca_file_path')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Webhook
|
||||||
|
fields = '__all__'
|
||||||
labels = {
|
labels = {
|
||||||
'type_create': 'Creations',
|
'type_create': 'Creations',
|
||||||
'type_update': 'Updates',
|
'type_update': 'Updates',
|
||||||
@ -123,14 +127,15 @@ class WebhookForm(BootstrapMixin, forms.ModelForm):
|
|||||||
class TagForm(BootstrapMixin, forms.ModelForm):
|
class TagForm(BootstrapMixin, forms.ModelForm):
|
||||||
slug = SlugField()
|
slug = SlugField()
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Tag', ('name', 'slug', 'color', 'description')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Tag
|
model = Tag
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'slug', 'color', 'description'
|
'name', 'slug', 'color', 'description'
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Tag', ('name', 'slug', 'color', 'description')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
class ConfigContextForm(BootstrapMixin, forms.ModelForm):
|
||||||
|
@ -53,17 +53,18 @@ class VRFForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('VRF', ('name', 'rd', 'enforce_unique', 'description', 'tags')),
|
||||||
|
('Route Targets', ('import_targets', 'export_targets')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = VRF
|
model = VRF
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'rd', 'enforce_unique', 'description', 'import_targets', 'export_targets', 'tenant_group', 'tenant',
|
'name', 'rd', 'enforce_unique', 'description', 'import_targets', 'export_targets', 'tenant_group', 'tenant',
|
||||||
'tags',
|
'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('VRF', ('name', 'rd', 'enforce_unique', 'description', 'tags')),
|
|
||||||
('Route Targets', ('import_targets', 'export_targets')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
labels = {
|
labels = {
|
||||||
'rd': "RD",
|
'rd': "RD",
|
||||||
}
|
}
|
||||||
@ -78,15 +79,16 @@ class RouteTargetForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Route Target', ('name', 'description', 'tags')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = RouteTarget
|
model = RouteTarget
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'description', 'tenant_group', 'tenant', 'tags',
|
'name', 'description', 'tenant_group', 'tenant', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Route Target', ('name', 'description', 'tags')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class RIRForm(NetBoxModelForm):
|
class RIRForm(NetBoxModelForm):
|
||||||
@ -113,15 +115,16 @@ class AggregateForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Aggregate', ('prefix', 'rir', 'date_added', 'description', 'tags')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Aggregate
|
model = Aggregate
|
||||||
fields = [
|
fields = [
|
||||||
'prefix', 'rir', 'date_added', 'description', 'tenant_group', 'tenant', 'tags',
|
'prefix', 'rir', 'date_added', 'description', 'tenant_group', 'tenant', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Aggregate', ('prefix', 'rir', 'date_added', 'description', 'tags')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
help_texts = {
|
help_texts = {
|
||||||
'prefix': "IPv4 or IPv6 network",
|
'prefix': "IPv4 or IPv6 network",
|
||||||
'rir': "Regional Internet Registry responsible for this prefix",
|
'rir': "Regional Internet Registry responsible for this prefix",
|
||||||
@ -146,15 +149,16 @@ class ASNForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('ASN', ('asn', 'rir', 'sites', 'description', 'tags')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = ASN
|
model = ASN
|
||||||
fields = [
|
fields = [
|
||||||
'asn', 'rir', 'sites', 'tenant_group', 'tenant', 'description', 'tags'
|
'asn', 'rir', 'sites', 'tenant_group', 'tenant', 'description', 'tags'
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('ASN', ('asn', 'rir', 'sites', 'description', 'tags')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
help_texts = {
|
help_texts = {
|
||||||
'asn': "AS number",
|
'asn': "AS number",
|
||||||
'rir': "Regional Internet Registry responsible for this prefix",
|
'rir': "Regional Internet Registry responsible for this prefix",
|
||||||
@ -248,17 +252,18 @@ class PrefixForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Prefix', ('prefix', 'status', 'vrf', 'role', 'is_pool', 'mark_utilized', 'description', 'tags')),
|
||||||
|
('Site/VLAN Assignment', ('region', 'site_group', 'site', 'vlan_group', 'vlan')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Prefix
|
model = Prefix
|
||||||
fields = [
|
fields = [
|
||||||
'prefix', 'vrf', 'site', 'vlan', 'status', 'role', 'is_pool', 'mark_utilized', 'description',
|
'prefix', 'vrf', 'site', 'vlan', 'status', 'role', 'is_pool', 'mark_utilized', 'description',
|
||||||
'tenant_group', 'tenant', 'tags',
|
'tenant_group', 'tenant', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('Prefix', ('prefix', 'status', 'vrf', 'role', 'is_pool', 'mark_utilized', 'description', 'tags')),
|
|
||||||
('Site/VLAN Assignment', ('region', 'site_group', 'site', 'vlan_group', 'vlan')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'status': StaticSelect(),
|
'status': StaticSelect(),
|
||||||
}
|
}
|
||||||
@ -279,15 +284,16 @@ class IPRangeForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('IP Range', ('vrf', 'start_address', 'end_address', 'role', 'status', 'description', 'tags')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = IPRange
|
model = IPRange
|
||||||
fields = [
|
fields = [
|
||||||
'vrf', 'start_address', 'end_address', 'status', 'role', 'description', 'tenant_group', 'tenant', 'tags',
|
'vrf', 'start_address', 'end_address', 'status', 'role', 'description', 'tenant_group', 'tenant', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('IP Range', ('vrf', 'start_address', 'end_address', 'role', 'status', 'description', 'tags')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'status': StaticSelect(),
|
'status': StaticSelect(),
|
||||||
}
|
}
|
||||||
@ -562,17 +568,18 @@ class FHRPGroupForm(NetBoxModelForm):
|
|||||||
label='Status'
|
label='Status'
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = FHRPGroup
|
|
||||||
fields = (
|
|
||||||
'protocol', 'group_id', 'auth_type', 'auth_key', 'description', 'ip_vrf', 'ip_address', 'ip_status', 'tags',
|
|
||||||
)
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('FHRP Group', ('protocol', 'group_id', 'description', 'tags')),
|
('FHRP Group', ('protocol', 'group_id', 'description', 'tags')),
|
||||||
('Authentication', ('auth_type', 'auth_key')),
|
('Authentication', ('auth_type', 'auth_key')),
|
||||||
('Virtual IP Address', ('ip_vrf', 'ip_address', 'ip_status'))
|
('Virtual IP Address', ('ip_vrf', 'ip_address', 'ip_status'))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = FHRPGroup
|
||||||
|
fields = (
|
||||||
|
'protocol', 'group_id', 'auth_type', 'auth_key', 'description', 'ip_vrf', 'ip_address', 'ip_status', 'tags',
|
||||||
|
)
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
instance = super().save(*args, **kwargs)
|
instance = super().save(*args, **kwargs)
|
||||||
|
|
||||||
@ -699,17 +706,18 @@ class VLANGroupForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('VLAN Group', ('name', 'slug', 'description', 'tags')),
|
||||||
|
('Child VLANs', ('min_vid', 'max_vid')),
|
||||||
|
('Scope', ('scope_type', 'region', 'sitegroup', 'site', 'location', 'rack', 'clustergroup', 'cluster')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = VLANGroup
|
model = VLANGroup
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'slug', 'description', 'scope_type', 'region', 'sitegroup', 'site', 'location', 'rack',
|
'name', 'slug', 'description', 'scope_type', 'region', 'sitegroup', 'site', 'location', 'rack',
|
||||||
'clustergroup', 'cluster', 'min_vid', 'max_vid', 'tags',
|
'clustergroup', 'cluster', 'min_vid', 'max_vid', 'tags',
|
||||||
]
|
]
|
||||||
fieldsets = (
|
|
||||||
('VLAN Group', ('name', 'slug', 'description', 'tags')),
|
|
||||||
('Child VLANs', ('min_vid', 'max_vid')),
|
|
||||||
('Scope', ('scope_type', 'region', 'sitegroup', 'site', 'location', 'rack', 'clustergroup', 'cluster')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'scope_type': StaticSelect,
|
'scope_type': StaticSelect,
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,13 @@ __all__ = (
|
|||||||
class NetBoxModelForm(BootstrapMixin, CustomFieldsMixin, forms.ModelForm):
|
class NetBoxModelForm(BootstrapMixin, CustomFieldsMixin, forms.ModelForm):
|
||||||
"""
|
"""
|
||||||
Base form for creating & editing NetBox models. Adds support for custom fields.
|
Base form for creating & editing NetBox models. Adds support for custom fields.
|
||||||
|
|
||||||
|
Attributes:
|
||||||
|
fieldsets: An iterable of two-tuples which define a heading and field set to display per section of
|
||||||
|
the rendered form (optional). If not defined, the all fields will be rendered as a single section.
|
||||||
"""
|
"""
|
||||||
|
fieldsets = ()
|
||||||
|
|
||||||
def _get_content_type(self):
|
def _get_content_type(self):
|
||||||
return ContentType.objects.get_for_model(self._meta.model)
|
return ContentType.objects.get_for_model(self._meta.model)
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{% block form %}
|
{% block form %}
|
||||||
{% if form.Meta.fieldsets %}
|
{% if form.fieldsets %}
|
||||||
|
|
||||||
{# Render hidden fields #}
|
{# Render hidden fields #}
|
||||||
{% for field in form.hidden_fields %}
|
{% for field in form.hidden_fields %}
|
||||||
@ -41,7 +41,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{# Render grouped fields according to Form #}
|
{# Render grouped fields according to Form #}
|
||||||
{% for group, fields in form.Meta.fieldsets %}
|
{% for group, fields in form.fieldsets %}
|
||||||
<div class="field-group mb-5">
|
<div class="field-group mb-5">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<h5 class="offset-sm-3">{{ group }}</h5>
|
<h5 class="offset-sm-3">{{ group }}</h5>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<form method="post" action="" id="preferences-update">
|
<form method="post" action="" id="preferences-update">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{% for group, fields in form.Meta.fieldsets %}
|
{% for group, fields in form.fieldsets %}
|
||||||
<div class="field-group my-5">
|
<div class="field-group my-5">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<h5 class="offset-sm-3">{{ group }}</h5>
|
<h5 class="offset-sm-3">{{ group }}</h5>
|
||||||
|
@ -52,14 +52,15 @@ class TenantForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Tenant', ('name', 'slug', 'group', 'description', 'tags')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Tenant
|
model = Tenant
|
||||||
fields = (
|
fields = (
|
||||||
'name', 'slug', 'group', 'description', 'comments', 'tags',
|
'name', 'slug', 'group', 'description', 'comments', 'tags',
|
||||||
)
|
)
|
||||||
fieldsets = (
|
|
||||||
('Tenant', ('name', 'slug', 'group', 'description', 'tags')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -105,14 +106,15 @@ class ContactForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Contact', ('group', 'name', 'title', 'phone', 'email', 'address', 'tags')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Contact
|
model = Contact
|
||||||
fields = (
|
fields = (
|
||||||
'group', 'name', 'title', 'phone', 'email', 'address', 'comments', 'tags',
|
'group', 'name', 'title', 'phone', 'email', 'address', 'comments', 'tags',
|
||||||
)
|
)
|
||||||
fieldsets = (
|
|
||||||
('Contact', ('group', 'name', 'title', 'phone', 'email', 'address', 'tags')),
|
|
||||||
)
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'address': SmallTextarea(attrs={'rows': 3}),
|
'address': SmallTextarea(attrs={'rows': 3}),
|
||||||
}
|
}
|
||||||
|
@ -40,10 +40,6 @@ class UserConfigFormMetaclass(forms.models.ModelFormMetaclass):
|
|||||||
|
|
||||||
|
|
||||||
class UserConfigForm(BootstrapMixin, forms.ModelForm, metaclass=UserConfigFormMetaclass):
|
class UserConfigForm(BootstrapMixin, forms.ModelForm, metaclass=UserConfigFormMetaclass):
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = UserConfig
|
|
||||||
fields = ()
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('User Interface', (
|
('User Interface', (
|
||||||
'pagination.per_page',
|
'pagination.per_page',
|
||||||
@ -55,6 +51,10 @@ class UserConfigForm(BootstrapMixin, forms.ModelForm, metaclass=UserConfigFormMe
|
|||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = UserConfig
|
||||||
|
fields = ()
|
||||||
|
|
||||||
def __init__(self, *args, instance=None, **kwargs):
|
def __init__(self, *args, instance=None, **kwargs):
|
||||||
|
|
||||||
# Get initial data from UserConfig instance
|
# Get initial data from UserConfig instance
|
||||||
|
@ -90,15 +90,16 @@ class ClusterForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fieldsets = (
|
||||||
|
('Cluster', ('name', 'type', 'group', 'region', 'site_group', 'site', 'tags')),
|
||||||
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Cluster
|
model = Cluster
|
||||||
fields = (
|
fields = (
|
||||||
'name', 'type', 'group', 'tenant', 'region', 'site_group', 'site', 'comments', 'tags',
|
'name', 'type', 'group', 'tenant', 'region', 'site_group', 'site', 'comments', 'tags',
|
||||||
)
|
)
|
||||||
fieldsets = (
|
|
||||||
('Cluster', ('name', 'type', 'group', 'region', 'site_group', 'site', 'tags')),
|
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ClusterAddDevicesForm(BootstrapMixin, forms.Form):
|
class ClusterAddDevicesForm(BootstrapMixin, forms.Form):
|
||||||
@ -206,12 +207,6 @@ class VirtualMachineForm(TenancyForm, NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = VirtualMachine
|
|
||||||
fields = [
|
|
||||||
'name', 'status', 'cluster_group', 'cluster', 'role', 'tenant_group', 'tenant', 'platform', 'primary_ip4',
|
|
||||||
'primary_ip6', 'vcpus', 'memory', 'disk', 'comments', 'tags', 'local_context_data',
|
|
||||||
]
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Virtual Machine', ('name', 'role', 'status', 'tags')),
|
('Virtual Machine', ('name', 'role', 'status', 'tags')),
|
||||||
('Cluster', ('cluster_group', 'cluster')),
|
('Cluster', ('cluster_group', 'cluster')),
|
||||||
@ -220,6 +215,13 @@ class VirtualMachineForm(TenancyForm, NetBoxModelForm):
|
|||||||
('Resources', ('vcpus', 'memory', 'disk')),
|
('Resources', ('vcpus', 'memory', 'disk')),
|
||||||
('Config Context', ('local_context_data',)),
|
('Config Context', ('local_context_data',)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = VirtualMachine
|
||||||
|
fields = [
|
||||||
|
'name', 'status', 'cluster_group', 'cluster', 'role', 'tenant_group', 'tenant', 'platform', 'primary_ip4',
|
||||||
|
'primary_ip6', 'vcpus', 'memory', 'disk', 'comments', 'tags', 'local_context_data',
|
||||||
|
]
|
||||||
help_texts = {
|
help_texts = {
|
||||||
'local_context_data': "Local config context data overwrites all sources contexts in the final rendered "
|
'local_context_data': "Local config context data overwrites all sources contexts in the final rendered "
|
||||||
"config context",
|
"config context",
|
||||||
|
@ -45,16 +45,17 @@ class WirelessLANForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = WirelessLAN
|
|
||||||
fields = [
|
|
||||||
'ssid', 'group', 'description', 'vlan', 'auth_type', 'auth_cipher', 'auth_psk', 'tags',
|
|
||||||
]
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Wireless LAN', ('ssid', 'group', 'description', 'tags')),
|
('Wireless LAN', ('ssid', 'group', 'description', 'tags')),
|
||||||
('VLAN', ('vlan',)),
|
('VLAN', ('vlan',)),
|
||||||
('Authentication', ('auth_type', 'auth_cipher', 'auth_psk')),
|
('Authentication', ('auth_type', 'auth_cipher', 'auth_psk')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = WirelessLAN
|
||||||
|
fields = [
|
||||||
|
'ssid', 'group', 'description', 'vlan', 'auth_type', 'auth_cipher', 'auth_psk', 'tags',
|
||||||
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
'auth_type': StaticSelect,
|
'auth_type': StaticSelect,
|
||||||
'auth_cipher': StaticSelect,
|
'auth_cipher': StaticSelect,
|
||||||
@ -141,18 +142,19 @@ class WirelessLinkForm(NetBoxModelForm):
|
|||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
|
||||||
model = WirelessLink
|
|
||||||
fields = [
|
|
||||||
'site_a', 'location_a', 'device_a', 'interface_a', 'site_b', 'location_b', 'device_b', 'interface_b',
|
|
||||||
'status', 'ssid', 'description', 'auth_type', 'auth_cipher', 'auth_psk', 'tags',
|
|
||||||
]
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Side A', ('site_a', 'location_a', 'device_a', 'interface_a')),
|
('Side A', ('site_a', 'location_a', 'device_a', 'interface_a')),
|
||||||
('Side B', ('site_b', 'location_b', 'device_b', 'interface_b')),
|
('Side B', ('site_b', 'location_b', 'device_b', 'interface_b')),
|
||||||
('Link', ('status', 'ssid', 'description', 'tags')),
|
('Link', ('status', 'ssid', 'description', 'tags')),
|
||||||
('Authentication', ('auth_type', 'auth_cipher', 'auth_psk')),
|
('Authentication', ('auth_type', 'auth_cipher', 'auth_psk')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = WirelessLink
|
||||||
|
fields = [
|
||||||
|
'site_a', 'location_a', 'device_a', 'interface_a', 'site_b', 'location_b', 'device_b', 'interface_b',
|
||||||
|
'status', 'ssid', 'description', 'auth_type', 'auth_cipher', 'auth_psk', 'tags',
|
||||||
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
'status': StaticSelect,
|
'status': StaticSelect,
|
||||||
'auth_type': StaticSelect,
|
'auth_type': StaticSelect,
|
||||||
|
Reference in New Issue
Block a user