mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Introduced CableView and CableEditView
This commit is contained in:
@@ -2131,7 +2131,7 @@ class RearPortBulkRenameForm(BulkRenameForm):
|
||||
# Cables
|
||||
#
|
||||
|
||||
class CableForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelForm):
|
||||
class CableCreateForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelForm):
|
||||
termination_b_site = forms.ModelChoiceField(
|
||||
queryset=Site.objects.all(),
|
||||
label='Site',
|
||||
@@ -2198,7 +2198,7 @@ class CableForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelForm):
|
||||
]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CableForm, self).__init__(*args, **kwargs)
|
||||
super(CableCreateForm, self).__init__(*args, **kwargs)
|
||||
|
||||
# Define available types for endpoint B based on the type of endpoint A
|
||||
termination_a_type = self.instance.termination_a._meta.model_name
|
||||
@@ -2207,6 +2207,13 @@ class CableForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelForm):
|
||||
)
|
||||
|
||||
|
||||
class CableForm(BootstrapMixin, forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = Cable
|
||||
fields = ('type', 'status', 'label', 'color')
|
||||
|
||||
|
||||
class CableFilterForm(BootstrapMixin, forms.Form):
|
||||
model = Cable
|
||||
q = forms.CharField(required=False, label='Search')
|
||||
|
||||
Reference in New Issue
Block a user