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 <[email protected]> Co-authored-by: Eric Hester <[email protected]>
This commit is contained in:
1 parent
3539539c4e
commit
a0a98bb407
12 files changed
+141
-10
No files matched your search
@@ -1,7 +1,7 @@
|
||||
from django.forms import DateField
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
from netbox.forms import NetBoxModelForm, NetBoxModelFilterSetForm
|
||||
from netbox.forms import NetBoxModelForm, NetBoxModelFilterSetForm, NetBoxModelImportForm
|
||||
from netbox_slm.models import SoftwareProduct, SoftwareProductVersion
|
||||
from utilities.forms.fields import CommentField, DynamicModelChoiceField, TagFilterField
|
||||
from utilities.forms.rendering import FieldSet
|
||||
@@ -25,6 +25,7 @@ class SoftwareProductVersionForm(NetBoxModelForm):
|
||||
model = SoftwareProductVersion
|
||||
fields = (
|
||||
"name",
|
||||
"software_product",
|
||||
"release_date",
|
||||
"documentation_url",
|
||||
"end_of_support",
|
||||
@@ -32,7 +33,6 @@ class SoftwareProductVersionForm(NetBoxModelForm):
|
||||
"file_checksum",
|
||||
"file_link",
|
||||
"release_type",
|
||||
"software_product",
|
||||
"tags",
|
||||
"comments",
|
||||
)
|
||||
@@ -42,3 +42,19 @@ class SoftwareProductVersionFilterForm(NetBoxModelFilterSetForm):
|
||||
model = SoftwareProductVersion
|
||||
fieldsets = (FieldSet(None, ("q", "tag")),)
|
||||
tag = TagFilterField(model)
|
||||
|
||||
|
||||
class SoftwareProductVersionBulkImportForm(NetBoxModelImportForm):
|
||||
class Meta:
|
||||
model = SoftwareProductVersion
|
||||
fields = (
|
||||
"name",
|
||||
"software_product",
|
||||
"release_date",
|
||||
"end_of_support",
|
||||
"filename",
|
||||
"file_checksum",
|
||||
"release_type",
|
||||
"tags",
|
||||
"comments",
|
||||
)
|
||||
Reference in new issue
Block a user