|
@@ -17,10 +17,11 @@ from tenancy.forms import TenancyForm
|
|
|
from tenancy.models import Tenant
|
|
from tenancy.models import Tenant
|
|
|
from utilities.forms import (
|
|
from utilities.forms import (
|
|
|
AnnotatedMultipleChoiceField, APISelect, add_blank_choice, ArrayFieldSelectMultiple, BootstrapMixin, BulkEditForm,
|
|
AnnotatedMultipleChoiceField, APISelect, add_blank_choice, ArrayFieldSelectMultiple, BootstrapMixin, BulkEditForm,
|
|
|
- BulkEditNullBooleanSelect, ChainedFieldsMixin, ChainedModelChoiceField, CommentField, ComponentForm,
|
|
|
|
|
- ConfirmationForm, CSVChoiceField, ExpandableNameField, FilterChoiceField, FilterTreeNodeMultipleChoiceField,
|
|
|
|
|
- FlexibleModelChoiceField, JSONField, Livesearch, SelectWithDisabled, SelectWithPK, SmallTextarea, SlugField,
|
|
|
|
|
- ContentTypeSelect
|
|
|
|
|
|
|
+ BulkEditNullBooleanSelect, ChainedFieldsMixin, ChainedModelChoiceField, ColorSelect, CommentField, ComponentForm,
|
|
|
|
|
+ ConfirmationForm, ContentTypeSelect, CSVChoiceField, ExpandableNameField, FilterChoiceField,
|
|
|
|
|
+ FilterTreeNodeMultipleChoiceField, FlexibleModelChoiceField, JSONField, Livesearch, SelectWithPK, SmallTextarea,
|
|
|
|
|
+ SlugField, COLOR_CHOICES,
|
|
|
|
|
+
|
|
|
)
|
|
)
|
|
|
from virtualization.models import Cluster
|
|
from virtualization.models import Cluster
|
|
|
from .constants import *
|
|
from .constants import *
|
|
@@ -2212,6 +2213,22 @@ class CableForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelForm):
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+class CableFilterForm(BootstrapMixin, forms.Form):
|
|
|
|
|
+ model = Cable
|
|
|
|
|
+ q = forms.CharField(required=False, label='Search')
|
|
|
|
|
+ type = AnnotatedMultipleChoiceField(
|
|
|
|
|
+ choices=CABLE_TYPE_CHOICES,
|
|
|
|
|
+ annotate=Cable.objects.all(),
|
|
|
|
|
+ annotate_field='type',
|
|
|
|
|
+ required=False
|
|
|
|
|
+ )
|
|
|
|
|
+ color = forms.ChoiceField(
|
|
|
|
|
+ choices=add_blank_choice(COLOR_CHOICES),
|
|
|
|
|
+ widget=ColorSelect(),
|
|
|
|
|
+ required=False
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
#
|
|
#
|
|
|
# Device bays
|
|
# Device bays
|
|
|
#
|
|
#
|