Merge pull request #3885 from hSaria/568-csv-import-cf

Fixes #568: CSV import/export of custom fields
This commit is contained in:
Jeremy Stretch
2020-01-29 10:11:40 -05:00
committed by GitHub
11 changed files with 114 additions and 25 deletions

View File

@@ -49,7 +49,7 @@ class VRFForm(BootstrapMixin, TenancyForm, CustomFieldForm):
}
class VRFCSVForm(forms.ModelForm):
class VRFCSVForm(CustomFieldForm):
tenant = forms.ModelChoiceField(
queryset=Tenant.objects.all(),
required=False,
@@ -166,7 +166,7 @@ class AggregateForm(BootstrapMixin, CustomFieldForm):
}
class AggregateCSVForm(forms.ModelForm):
class AggregateCSVForm(CustomFieldForm):
rir = forms.ModelChoiceField(
queryset=RIR.objects.all(),
to_field_name='name',
@@ -341,7 +341,7 @@ class PrefixForm(BootstrapMixin, TenancyForm, CustomFieldForm):
self.fields['vrf'].empty_label = 'Global'
class PrefixCSVForm(forms.ModelForm):
class PrefixCSVForm(CustomFieldForm):
vrf = FlexibleModelChoiceField(
queryset=VRF.objects.all(),
to_field_name='rd',
@@ -771,7 +771,7 @@ class IPAddressBulkAddForm(BootstrapMixin, TenancyForm, CustomFieldForm):
self.fields['vrf'].empty_label = 'Global'
class IPAddressCSVForm(forms.ModelForm):
class IPAddressCSVForm(CustomFieldForm):
vrf = FlexibleModelChoiceField(
queryset=VRF.objects.all(),
to_field_name='rd',
@@ -1135,7 +1135,7 @@ class VLANForm(BootstrapMixin, TenancyForm, CustomFieldForm):
}
class VLANCSVForm(forms.ModelForm):
class VLANCSVForm(CustomFieldForm):
site = forms.ModelChoiceField(
queryset=Site.objects.all(),
required=False,