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

Remove APISelect widget/api_url argument from dynamic fields

This commit is contained in:
Jeremy Stretch
2020-03-16 14:08:48 -04:00
parent 400f6fc5fb
commit 0068108c57
8 changed files with 106 additions and 552 deletions

View File

@@ -44,10 +44,7 @@ class TenantForm(BootstrapMixin, CustomFieldModelForm):
slug = SlugField()
group = DynamicModelChoiceField(
queryset=TenantGroup.objects.all(),
required=False,
widget=APISelect(
api_url="/api/tenancy/tenant-groups/"
)
required=False
)
comments = CommentField()
tags = TagField(
@@ -89,10 +86,7 @@ class TenantBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditF
)
group = DynamicModelChoiceField(
queryset=TenantGroup.objects.all(),
required=False,
widget=APISelect(
api_url="/api/tenancy/tenant-groups/"
)
required=False
)
class Meta:
@@ -112,7 +106,6 @@ class TenantFilterForm(BootstrapMixin, CustomFieldFilterForm):
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/tenancy/tenant-groups/",
value_field="slug",
null_option=True,
)
@@ -129,7 +122,6 @@ class TenancyForm(forms.Form):
queryset=TenantGroup.objects.all(),
required=False,
widget=APISelect(
api_url="/api/tenancy/tenant-groups/",
filter_for={
'tenant': 'group_id',
},
@@ -140,10 +132,7 @@ class TenancyForm(forms.Form):
)
tenant = DynamicModelChoiceField(
queryset=Tenant.objects.all(),
required=False,
widget=APISelect(
api_url='/api/tenancy/tenants/'
)
required=False
)
def __init__(self, *args, **kwargs):
@@ -164,7 +153,6 @@ class TenancyFilterForm(forms.Form):
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/tenancy/tenant-groups/",
value_field="slug",
null_option=True,
filter_for={
@@ -177,7 +165,6 @@ class TenancyFilterForm(forms.Form):
to_field_name='slug',
required=False,
widget=APISelectMultiple(
api_url="/api/tenancy/tenants/",
value_field="slug",
null_option=True,
)