Replace NetBoxModelCSVForm with NetBoxModelImportForm (#19)

Closes #18
This commit is contained in:
wkoot
2023-06-06 21:16:13 +02:00
committed by GitHub
parent 88edcde8d6
commit 5b96496b46
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from dcim.models import Manufacturer, Device from dcim.models import Manufacturer, Device
from netbox.forms import NetBoxModelForm, NetBoxModelCSVForm, NetBoxModelBulkEditForm, NetBoxModelFilterSetForm from netbox.forms import NetBoxModelForm, NetBoxModelImportForm, NetBoxModelBulkEditForm, NetBoxModelFilterSetForm
from netbox_slm.models import SoftwareProduct, SoftwareProductVersion, SoftwareProductInstallation from netbox_slm.models import SoftwareProduct, SoftwareProductVersion, SoftwareProductInstallation
from utilities.forms import DynamicModelChoiceField, APISelect, TagFilterField from utilities.forms import DynamicModelChoiceField, APISelect, TagFilterField
from virtualization.models import VirtualMachine from virtualization.models import VirtualMachine
@@ -31,7 +31,7 @@ class SoftwareProductFilterForm(NetBoxModelFilterSetForm):
tag = TagFilterField(model) tag = TagFilterField(model)
class SoftwareProductCSVForm(NetBoxModelCSVForm): class SoftwareProductImportForm(NetBoxModelImportForm):
class Meta: class Meta:
model = SoftwareProduct model = SoftwareProduct
fields = ("name", "manufacturer",) fields = ("name", "manufacturer",)
@@ -73,7 +73,7 @@ class SoftwareProductVersionFilterForm(NetBoxModelFilterSetForm):
tag = TagFilterField(model) tag = TagFilterField(model)
class SoftwareProductVersionCSVForm(NetBoxModelCSVForm): class SoftwareProductVersionImportForm(NetBoxModelImportForm):
class Meta: class Meta:
model = SoftwareProductVersion model = SoftwareProductVersion
fields = ("name",) fields = ("name",)
@@ -146,7 +146,7 @@ class SoftwareProductInstallationFilterForm(NetBoxModelFilterSetForm):
tag = TagFilterField(model) tag = TagFilterField(model)
class SoftwareProductInstallationCSVForm(NetBoxModelCSVForm): class SoftwareProductInstallationImportForm(NetBoxModelImportForm):
class Meta: class Meta:
model = SoftwareProductInstallation model = SoftwareProductInstallation
fields = tuple() fields = tuple()
+3 -3
View File
@@ -37,7 +37,7 @@ class SoftwareProductDeleteView(generic.ObjectDeleteView):
class SoftwareProductBulkImportView(generic.BulkImportView): class SoftwareProductBulkImportView(generic.BulkImportView):
queryset = SoftwareProduct.objects.all() queryset = SoftwareProduct.objects.all()
model_form = forms.SoftwareProductCSVForm model_form = forms.SoftwareProductImportForm
table = tables.SoftwareProductTable table = tables.SoftwareProductTable
@@ -88,7 +88,7 @@ class SoftwareProductVersionDeleteView(generic.ObjectDeleteView):
class SoftwareProductVersionBulkImportView(generic.BulkImportView): class SoftwareProductVersionBulkImportView(generic.BulkImportView):
queryset = SoftwareProductVersion.objects.all() queryset = SoftwareProductVersion.objects.all()
model_form = forms.SoftwareProductVersionCSVForm model_form = forms.SoftwareProductVersionImportForm
table = tables.SoftwareProductVersionTable table = tables.SoftwareProductVersionTable
@@ -134,7 +134,7 @@ class SoftwareProductInstallationDeleteView(generic.ObjectDeleteView):
class SoftwareProductInstallationBulkImportView(generic.BulkImportView): class SoftwareProductInstallationBulkImportView(generic.BulkImportView):
queryset = SoftwareProductInstallation.objects.all() queryset = SoftwareProductInstallation.objects.all()
model_form = forms.SoftwareProductInstallationCSVForm model_form = forms.SoftwareProductInstallationImportForm
table = tables.SoftwareProductInstallationTable table = tables.SoftwareProductInstallationTable