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

Introduced DeviceComponentCreateView

This commit is contained in:
Jeremy Stretch
2016-12-21 15:26:56 -05:00
parent 37b2ff02e7
commit 7b06f5e9fc
4 changed files with 549 additions and 688 deletions

View File

@@ -13,6 +13,7 @@ from utilities.forms import (
SlugField,
)
from formfields import MACAddressFormField
from .models import (
DeviceBay, DeviceBayTemplate, CONNECTION_STATUS_CHOICES, CONNECTION_STATUS_PLANNED, CONNECTION_STATUS_CONNECTED,
ConsolePort, ConsolePortTemplate, ConsoleServerPort, ConsoleServerPortTemplate, Device, DeviceRole, DeviceType,
@@ -1032,12 +1033,12 @@ class InterfaceForm(BootstrapMixin, forms.ModelForm):
}
class InterfaceCreateForm(BootstrapMixin, forms.ModelForm):
class InterfaceCreateForm(BootstrapMixin, forms.Form):
name_pattern = ExpandableNameField(label='Name')
class Meta:
model = Interface
fields = ['name_pattern', 'form_factor', 'mac_address', 'mgmt_only', 'description']
form_factor = forms.ChoiceField(choices=IFACE_FF_CHOICES)
mac_address = MACAddressFormField(required=False, label='MAC Address')
mgmt_only = forms.BooleanField(required=False, label='OOB Management')
description = forms.CharField(max_length=100, required=False)
class InterfaceBulkEditForm(BootstrapMixin, BulkEditForm):