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 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 utilities.forms import DynamicModelChoiceField, APISelect, TagFilterField
from virtualization.models import VirtualMachine
@@ -31,7 +31,7 @@ class SoftwareProductFilterForm(NetBoxModelFilterSetForm):
tag = TagFilterField(model)
class SoftwareProductCSVForm(NetBoxModelCSVForm):
class SoftwareProductImportForm(NetBoxModelImportForm):
class Meta:
model = SoftwareProduct
fields = ("name", "manufacturer",)
@@ -73,7 +73,7 @@ class SoftwareProductVersionFilterForm(NetBoxModelFilterSetForm):
tag = TagFilterField(model)
class SoftwareProductVersionCSVForm(NetBoxModelCSVForm):
class SoftwareProductVersionImportForm(NetBoxModelImportForm):
class Meta:
model = SoftwareProductVersion
fields = ("name",)
@@ -146,7 +146,7 @@ class SoftwareProductInstallationFilterForm(NetBoxModelFilterSetForm):
tag = TagFilterField(model)
class SoftwareProductInstallationCSVForm(NetBoxModelCSVForm):
class SoftwareProductInstallationImportForm(NetBoxModelImportForm):
class Meta:
model = SoftwareProductInstallation
fields = tuple()
+3 -3
View File
@@ -37,7 +37,7 @@ class SoftwareProductDeleteView(generic.ObjectDeleteView):
class SoftwareProductBulkImportView(generic.BulkImportView):
queryset = SoftwareProduct.objects.all()
model_form = forms.SoftwareProductCSVForm
model_form = forms.SoftwareProductImportForm
table = tables.SoftwareProductTable
@@ -88,7 +88,7 @@ class SoftwareProductVersionDeleteView(generic.ObjectDeleteView):
class SoftwareProductVersionBulkImportView(generic.BulkImportView):
queryset = SoftwareProductVersion.objects.all()
model_form = forms.SoftwareProductVersionCSVForm
model_form = forms.SoftwareProductVersionImportForm
table = tables.SoftwareProductVersionTable
@@ -134,7 +134,7 @@ class SoftwareProductInstallationDeleteView(generic.ObjectDeleteView):
class SoftwareProductInstallationBulkImportView(generic.BulkImportView):
queryset = SoftwareProductInstallation.objects.all()
model_form = forms.SoftwareProductInstallationCSVForm
model_form = forms.SoftwareProductInstallationImportForm
table = tables.SoftwareProductInstallationTable