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

initial static select2 fields

This commit is contained in:
John Anderson
2019-01-03 23:02:05 -05:00
parent 5285b6926f
commit 81a0889568
4 changed files with 27 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ from utilities.forms import (
BulkEditNullBooleanSelect, ChainedFieldsMixin, ChainedModelChoiceField, ColorSelect, CommentField, ComponentForm,
ConfirmationForm, ContentTypeSelect, CSVChoiceField, ExpandableNameField, FilterChoiceField,
FilterTreeNodeMultipleChoiceField, FlexibleModelChoiceField, JSONField, Livesearch, SelectWithPK, SmallTextarea,
SlugField, BOOLEAN_WITH_BLANK_CHOICES, COLOR_CHOICES,
SlugField, StaticSelect2, BOOLEAN_WITH_BLANK_CHOICES, COLOR_CHOICES,
)
from virtualization.models import Cluster, ClusterGroup
@@ -109,7 +109,10 @@ class RegionFilterForm(BootstrapMixin, forms.Form):
class SiteForm(BootstrapMixin, TenancyForm, CustomFieldForm):
region = TreeNodeChoiceField(
queryset=Region.objects.all(),
required=False
required=False,
widget=APISelect(
api_url="/api/dcim/regions/"
)
)
slug = SlugField()
comments = CommentField()
@@ -135,6 +138,8 @@ class SiteForm(BootstrapMixin, TenancyForm, CustomFieldForm):
'rows': 3,
}
),
'status': StaticSelect2(),
'time_zone': StaticSelect2(),
}
help_texts = {
'name': "Full name of the site",