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

Closes #2601: Added a description field to pass-through ports

This commit is contained in:
Jeremy Stretch
2018-11-20 21:28:19 -05:00
parent 240d22696f
commit d59be2912e
9 changed files with 38 additions and 9 deletions

View File

@@ -1685,13 +1685,13 @@ class FrontPortForm(BootstrapMixin, forms.ModelForm):
class Meta:
model = FrontPort
fields = ['device', 'name', 'type', 'rear_port', 'rear_port_position', 'tags']
fields = ['device', 'name', 'type', 'rear_port', 'rear_port_position', 'description', 'tags']
widgets = {
'device': forms.HiddenInput(),
}
# TODO: Merge with FrontPortTemplateCreateForm to remove duplicate logic
# TODO: Merge with FrontPortTemplateCreateForm to remove duplicate logic
class FrontPortCreateForm(ComponentForm):
name_pattern = ExpandableNameField(
label='Name'
@@ -1704,6 +1704,9 @@ class FrontPortCreateForm(ComponentForm):
label='Rear ports',
help_text='Select one rear port assignment for each front port being created.'
)
description = forms.CharField(
required=False
)
def __init__(self, *args, **kwargs):
@@ -1771,7 +1774,7 @@ class RearPortForm(BootstrapMixin, forms.ModelForm):
class Meta:
model = RearPort
fields = ['device', 'name', 'type', 'positions', 'tags']
fields = ['device', 'name', 'type', 'positions', 'description', 'tags']
widgets = {
'device': forms.HiddenInput(),
}
@@ -1790,6 +1793,9 @@ class RearPortCreateForm(ComponentForm):
initial=1,
help_text='The number of front ports which may be mapped to each rear port'
)
description = forms.CharField(
required=False
)
class RearPortBulkRenameForm(BulkRenameForm):