mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 17:26:10 -06:00
#9047 - Move to new selector types
This commit is contained in:
parent
71b8a8c511
commit
c91d8bdbed
@ -41,7 +41,8 @@ class ProviderForm(NetBoxModelForm):
|
|||||||
|
|
||||||
class ProviderAccountForm(NetBoxModelForm):
|
class ProviderAccountForm(NetBoxModelForm):
|
||||||
provider = DynamicModelChoiceField(
|
provider = DynamicModelChoiceField(
|
||||||
queryset=Provider.objects.all()
|
queryset=Provider.objects.all(),
|
||||||
|
selector=True
|
||||||
)
|
)
|
||||||
comments = CommentField()
|
comments = CommentField()
|
||||||
|
|
||||||
@ -86,13 +87,6 @@ class CircuitTypeForm(NetBoxModelForm):
|
|||||||
|
|
||||||
|
|
||||||
class CircuitForm(TenancyForm, NetBoxModelForm):
|
class CircuitForm(TenancyForm, NetBoxModelForm):
|
||||||
provider = DynamicModelChoiceField(
|
|
||||||
required=False,
|
|
||||||
queryset=Provider.objects.all(),
|
|
||||||
initial_params={
|
|
||||||
'accounts': '$provider_account'
|
|
||||||
},
|
|
||||||
)
|
|
||||||
provider_account = DynamicModelChoiceField(
|
provider_account = DynamicModelChoiceField(
|
||||||
queryset=ProviderAccount.objects.all(),
|
queryset=ProviderAccount.objects.all(),
|
||||||
initial_params={
|
initial_params={
|
||||||
@ -100,7 +94,8 @@ class CircuitForm(TenancyForm, NetBoxModelForm):
|
|||||||
},
|
},
|
||||||
query_params={
|
query_params={
|
||||||
'provider': '$provider',
|
'provider': '$provider',
|
||||||
}
|
},
|
||||||
|
selector=True
|
||||||
)
|
)
|
||||||
type = DynamicModelChoiceField(
|
type = DynamicModelChoiceField(
|
||||||
queryset=CircuitType.objects.all()
|
queryset=CircuitType.objects.all()
|
||||||
@ -108,7 +103,7 @@ class CircuitForm(TenancyForm, NetBoxModelForm):
|
|||||||
comments = CommentField()
|
comments = CommentField()
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
('Circuit', ('provider', 'provider_account', 'cid', 'type', 'status', 'description', 'tags')),
|
('Circuit', ('provider_account', 'cid', 'type', 'status', 'description', 'tags')),
|
||||||
('Service Parameters', ('install_date', 'termination_date', 'commit_rate')),
|
('Service Parameters', ('install_date', 'termination_date', 'commit_rate')),
|
||||||
('Tenancy', ('tenant_group', 'tenant')),
|
('Tenancy', ('tenant_group', 'tenant')),
|
||||||
)
|
)
|
||||||
@ -116,7 +111,7 @@ class CircuitForm(TenancyForm, NetBoxModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Circuit
|
model = Circuit
|
||||||
fields = [
|
fields = [
|
||||||
'cid', 'type', 'provider', 'provider_account', 'status', 'install_date', 'termination_date', 'commit_rate',
|
'cid', 'type', 'provider_account', 'status', 'install_date', 'termination_date', 'commit_rate',
|
||||||
'description', 'tenant_group', 'tenant', 'comments', 'tags',
|
'description', 'tenant_group', 'tenant', 'comments', 'tags',
|
||||||
]
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
@ -127,13 +122,6 @@ class CircuitForm(TenancyForm, NetBoxModelForm):
|
|||||||
|
|
||||||
|
|
||||||
class CircuitTerminationForm(NetBoxModelForm):
|
class CircuitTerminationForm(NetBoxModelForm):
|
||||||
provider = DynamicModelChoiceField(
|
|
||||||
queryset=Provider.objects.all(),
|
|
||||||
required=False,
|
|
||||||
initial_params={
|
|
||||||
'accounts': '$provider_account'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
provider_account = DynamicModelChoiceField(
|
provider_account = DynamicModelChoiceField(
|
||||||
queryset=ProviderAccount.objects.all(),
|
queryset=ProviderAccount.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
@ -142,7 +130,8 @@ class CircuitTerminationForm(NetBoxModelForm):
|
|||||||
},
|
},
|
||||||
query_params={
|
query_params={
|
||||||
'provider': '$provider',
|
'provider': '$provider',
|
||||||
}
|
},
|
||||||
|
selector=True
|
||||||
)
|
)
|
||||||
circuit = DynamicModelChoiceField(
|
circuit = DynamicModelChoiceField(
|
||||||
queryset=Circuit.objects.all(),
|
queryset=Circuit.objects.all(),
|
||||||
@ -164,7 +153,7 @@ class CircuitTerminationForm(NetBoxModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = CircuitTermination
|
model = CircuitTermination
|
||||||
fields = [
|
fields = [
|
||||||
'provider', 'provider_account', 'circuit', 'term_side', 'site', 'provider_network', 'mark_connected',
|
'provider_account', 'circuit', 'term_side', 'site', 'provider_network', 'mark_connected',
|
||||||
'port_speed', 'upstream_speed', 'xconnect_id', 'pp_info', 'description', 'tags',
|
'port_speed', 'upstream_speed', 'xconnect_id', 'pp_info', 'description', 'tags',
|
||||||
]
|
]
|
||||||
widgets = {
|
widgets = {
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<h5 class="offset-sm-3">Circuit Termination</h5>
|
<h5 class="offset-sm-3">Circuit Termination</h5>
|
||||||
</div>
|
</div>
|
||||||
{% render_field form.provider %}
|
|
||||||
{% render_field form.provider_account %}
|
{% render_field form.provider_account %}
|
||||||
{% render_field form.circuit %}
|
{% render_field form.circuit %}
|
||||||
{% render_field form.term_side %}
|
{% render_field form.term_side %}
|
||||||
|
Loading…
Reference in New Issue
Block a user