|
|
@@ -1,12 +1,16 @@
|
|
|
+from django import forms
|
|
|
+
|
|
|
from circuits.choices import CircuitStatusChoices
|
|
|
from circuits.models import *
|
|
|
+from dcim.models import Site
|
|
|
from django.utils.translation import gettext as _
|
|
|
from netbox.forms import NetBoxModelImportForm
|
|
|
from tenancy.models import Tenant
|
|
|
-from utilities.forms import CSVChoiceField, CSVModelChoiceField, SlugField
|
|
|
+from utilities.forms import BootstrapMixin, CSVChoiceField, CSVModelChoiceField, SlugField
|
|
|
|
|
|
__all__ = (
|
|
|
'CircuitImportForm',
|
|
|
+ 'CircuitTerminationImportForm',
|
|
|
'CircuitTypeImportForm',
|
|
|
'ProviderImportForm',
|
|
|
'ProviderNetworkImportForm',
|
|
|
@@ -76,3 +80,23 @@ class CircuitImportForm(NetBoxModelImportForm):
|
|
|
'cid', 'provider', 'type', 'status', 'tenant', 'install_date', 'termination_date', 'commit_rate',
|
|
|
'description', 'comments', 'tags'
|
|
|
]
|
|
|
+
|
|
|
+
|
|
|
+class CircuitTerminationImportForm(BootstrapMixin, forms.ModelForm):
|
|
|
+ site = CSVModelChoiceField(
|
|
|
+ queryset=Site.objects.all(),
|
|
|
+ to_field_name='name',
|
|
|
+ required=False
|
|
|
+ )
|
|
|
+ provider_network = CSVModelChoiceField(
|
|
|
+ queryset=ProviderNetwork.objects.all(),
|
|
|
+ to_field_name='name',
|
|
|
+ required=False
|
|
|
+ )
|
|
|
+
|
|
|
+ class Meta:
|
|
|
+ model = CircuitTermination
|
|
|
+ fields = [
|
|
|
+ 'circuit', 'term_side', 'site', 'provider_network', 'port_speed', 'upstream_speed', 'xconnect_id',
|
|
|
+ 'pp_info', 'description',
|
|
|
+ ]
|