Implement bulk imports and edits for SLM models (#46)

Partially implements #4
Based on @erichester76's https://github.com/ICTU/netbox_slm/pull/44

Signed-off-by: wkoot <3715211+wkoot@users.noreply.github.com>
Co-authored-by: Eric Hester <eric.hester@umbrella.tech>
This commit is contained in:
wkoot
2024-10-14 13:41:22 +02:00
committed by GitHub
co-authored by Eric Hester
parent 3539539c4e
commit a0a98bb407
12 changed files with 141 additions and 10 deletions
+13 -1
View File
@@ -1,5 +1,5 @@
from dcim.models import Manufacturer
from netbox.forms import NetBoxModelForm, NetBoxModelFilterSetForm
from netbox.forms import NetBoxModelForm, NetBoxModelFilterSetForm, NetBoxModelImportForm
from netbox_slm.models import SoftwareProduct
from utilities.forms.fields import CommentField, DynamicModelChoiceField, TagFilterField
from utilities.forms.rendering import FieldSet
@@ -30,3 +30,15 @@ class SoftwareProductFilterForm(NetBoxModelFilterSetForm):
model = SoftwareProduct
fieldsets = (FieldSet(None, ("q", "tag")),)
tag = TagFilterField(model)
class SoftwareProductBulkImportForm(NetBoxModelImportForm):
class Meta:
model = SoftwareProduct
fields = (
"name",
"description",
"manufacturer",
"tags",
"comments",
)