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>
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
from netbox.views import generic
|
|
from netbox_slm import filtersets, forms, tables
|
|
from netbox_slm.models import SoftwareLicense
|
|
|
|
|
|
class SoftwareLicenseListView(generic.ObjectListView):
|
|
"""View for listing all existing SoftwareLicenses."""
|
|
|
|
queryset = SoftwareLicense.objects.all()
|
|
filterset = filtersets.SoftwareLicenseFilterSet
|
|
filterset_form = forms.SoftwareLicenseFilterForm
|
|
table = tables.SoftwareLicenseTable
|
|
|
|
|
|
class SoftwareLicenseView(generic.ObjectView):
|
|
"""Display SoftwareLicense details"""
|
|
|
|
queryset = SoftwareLicense.objects.all()
|
|
|
|
|
|
class SoftwareLicenseEditView(generic.ObjectEditView):
|
|
"""View for editing and creating a SoftwareLicense instance."""
|
|
|
|
queryset = SoftwareLicense.objects.all()
|
|
form = forms.SoftwareLicenseForm
|
|
|
|
|
|
class SoftwareLicenseDeleteView(generic.ObjectDeleteView):
|
|
"""View for deleting a SoftwareLicense instance"""
|
|
|
|
queryset = SoftwareLicense.objects.all()
|
|
|
|
|
|
class SoftwareLicenseBulkDeleteView(generic.BulkDeleteView):
|
|
queryset = SoftwareLicense.objects.all()
|
|
table = tables.SoftwareLicenseTable
|
|
|
|
|
|
class SoftwareLicenseBulkImportView(generic.BulkImportView):
|
|
queryset = SoftwareLicense.objects.all()
|
|
table = tables.SoftwareLicenseTable
|
|
model_form = forms.SoftwareLicenseBulkImportForm
|