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

#6732 - Fix CSV import form

This commit is contained in:
Daniel Sheppard
2021-10-28 11:48:50 -05:00
parent 0f68ecda78
commit ada81e31c9

View File

@ -1,5 +1,6 @@
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.forms import IntegerField
from dcim.models import Device, Interface, Site
from extras.forms import CustomFieldModelCSVForm
@ -83,17 +84,12 @@ class AggregateCSVForm(CustomFieldModelCSVForm):
class ASNCSVForm(CustomFieldModelCSVForm):
slug = SlugField()
asn = IntegerField()
rir = CSVModelChoiceField(
queryset=RIR.objects.all(),
to_field_name='name',
help_text='Assigned RIR'
)
sites = CSVModelChoiceField(
queryset=Site.objects.all(),
to_field_name='name',
help_text='Assigned site'
)
tenant = CSVModelChoiceField(
queryset=Tenant.objects.all(),
required=False,