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

Closes #647: Extend form used when assigning an IP to a device

This commit is contained in:
Jeremy Stretch
2016-11-01 13:59:24 -04:00
parent 084b86cab1
commit f2137683f9
7 changed files with 68 additions and 18 deletions

View File

@@ -1228,15 +1228,12 @@ class InterfaceConnectionFilterForm(forms.Form, BootstrapMixin):
# IP addresses
#
class IPAddressForm(forms.ModelForm, BootstrapMixin):
class IPAddressForm(BootstrapMixin, CustomFieldForm):
set_as_primary = forms.BooleanField(label='Set as primary IP for device', required=False)
class Meta:
model = IPAddress
fields = ['address', 'vrf', 'interface', 'set_as_primary']
help_texts = {
'address': 'IPv4 or IPv6 address (with mask)'
}
fields = ['address', 'vrf', 'tenant', 'status', 'interface', 'description']
def __init__(self, device, *args, **kwargs):