From 67859444cffa12b04ccc40c5b0f25c54392daf92 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Sun, 8 Sep 2024 20:47:58 -0500 Subject: [PATCH 1/3] Version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 11f31f2..232b871 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='netbox-lifecycle', - version='1.1.1', + version='1.1.2-beta1', description='NetBox Lifecycle', long_description='NetBox Support Contract and EOL/EOS management', url='https://github.com/dansheps/netbox-lifecycle/', From 8be11d430ecb1f99380e9895a6172a46056693c5 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Mon, 9 Sep 2024 00:04:43 -0500 Subject: [PATCH 2/3] Fix fieldsets --- netbox_lifecycle/forms/bulk_edit.py | 5 +++-- netbox_lifecycle/forms/filtersets.py | 25 +++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/netbox_lifecycle/forms/bulk_edit.py b/netbox_lifecycle/forms/bulk_edit.py index 6eaf7fd..c9b4fc7 100644 --- a/netbox_lifecycle/forms/bulk_edit.py +++ b/netbox_lifecycle/forms/bulk_edit.py @@ -4,6 +4,7 @@ from utilities.forms.fields import DynamicModelChoiceField from netbox_lifecycle.models import SupportContract, SupportSKU, SupportContractAssignment, LicenseAssignment +from utilities.forms.rendering import FieldSet class SupportContractAssignmentBulkEditForm(NetBoxModelBulkEditForm): @@ -22,7 +23,7 @@ class SupportContractAssignmentBulkEditForm(NetBoxModelBulkEditForm): model = SupportContractAssignment fieldsets = ( - (None, ('contract', 'sku')), + FieldSet('contract', 'sku'), ) nullable_fields = () @@ -43,6 +44,6 @@ class LicenseAssignmentBulkEditForm(NetBoxModelBulkEditForm): model = LicenseAssignment fieldsets = ( - (None, ('vendor', 'license', 'quantity')), + FieldSet('vendor', 'license', 'quantity'), ) nullable_fields = ('quantity', ) diff --git a/netbox_lifecycle/forms/filtersets.py b/netbox_lifecycle/forms/filtersets.py index 084d177..2bef379 100644 --- a/netbox_lifecycle/forms/filtersets.py +++ b/netbox_lifecycle/forms/filtersets.py @@ -8,6 +8,7 @@ SupportContractAssignment, SupportSKU from utilities.filters import MultiValueCharFilter, MultiValueNumberFilter from utilities.forms.fields import DynamicModelMultipleChoiceField, TagFilterField +from utilities.forms.rendering import FieldSet from utilities.forms.widgets import APISelectMultiple @@ -25,8 +26,8 @@ class HardwareLifecycleFilterForm(NetBoxModelFilterSetForm): model = HardwareLifecycle fieldsets = ( - (None, ('q', 'filter_id', 'tag')), - ('Hardware', ('assigned_object_type_id', )) + FieldSet('q', 'filter_id', 'tag'), + FieldSet('assigned_object_type_id', name=_('Hardware')) ) assigned_object_type_id = DynamicModelMultipleChoiceField( @@ -43,7 +44,7 @@ class HardwareLifecycleFilterForm(NetBoxModelFilterSetForm): class SupportSKUFilterForm(NetBoxModelFilterSetForm): model = SupportSKU fieldsets = ( - (None, ('q', 'filter_id', 'tag', 'manufacturer_id')), + FieldSet('q', 'filter_id', 'tag', 'manufacturer_id'), ) manufacturer_id = DynamicModelMultipleChoiceField( queryset=Manufacturer.objects.all(), @@ -57,8 +58,8 @@ class SupportSKUFilterForm(NetBoxModelFilterSetForm): class SupportContractFilterForm(NetBoxModelFilterSetForm): model = SupportContract fieldsets = ( - (None, ('q', 'filter_id', 'tag')), - ('Purchase Information', ('vendor_id', )), + FieldSet('q', 'filter_id', 'tag'), + FieldSet('vendor_id', name='Purchase Information'), ) vendor_id = DynamicModelMultipleChoiceField( queryset=Vendor.objects.all(), @@ -72,7 +73,7 @@ class SupportContractFilterForm(NetBoxModelFilterSetForm): class VendorFilterForm(NetBoxModelFilterSetForm): model = Vendor fieldsets = ( - (None, ('q', 'filter_id', 'tag')), + FieldSet('q', 'filter_id', 'tag'), ) tag = TagFilterField(model) @@ -80,8 +81,8 @@ class VendorFilterForm(NetBoxModelFilterSetForm): class LicenseFilterForm(NetBoxModelFilterSetForm): model = License fieldsets = ( - (None, ('q', 'filter_id', 'tag')), - ('License Information', ('manufacturer_id', )), + FieldSet('q', 'filter_id', 'tag'), + FieldSet('manufacturer_id', name='License Information'), ) manufacturer_id = DynamicModelMultipleChoiceField( queryset=Manufacturer.objects.all(), @@ -95,8 +96,8 @@ class LicenseFilterForm(NetBoxModelFilterSetForm): class SupportContractAssignmentFilterForm(NetBoxModelFilterSetForm): model = SupportContractAssignment fieldsets = ( - (None, ('q', 'filter_id', 'tag')), - ('Assignment', ('contract_id', 'device_id', 'license_id', )), + FieldSet('q', 'filter_id', 'tag'), + FieldSet('contract_id', 'device_id', 'license_id', name='Assignment'), ) contract_id = DynamicModelMultipleChoiceField( queryset=SupportContract.objects.all(), @@ -122,8 +123,8 @@ class SupportContractAssignmentFilterForm(NetBoxModelFilterSetForm): class LicenseAssignmentFilterForm(NetBoxModelFilterSetForm): model = LicenseAssignment fieldsets = ( - (None, ('q', 'filter_id', 'tag')), - ('Assignment', ('license_id', 'vendor_id', 'device_id', )), + FieldSet('q', 'filter_id', 'tag'), + FieldSet('license_id', 'vendor_id', 'device_id', name='Assignment'), ) license_id = DynamicModelMultipleChoiceField( queryset=License.objects.all(), From 8d14fecd07990cc125a762e16f0143e6bdc181ca Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Mon, 9 Sep 2024 00:05:27 -0500 Subject: [PATCH 3/3] Fix fieldsets --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 232b871..abbbf18 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='netbox-lifecycle', - version='1.1.2-beta1', + version='1.1.2', description='NetBox Lifecycle', long_description='NetBox Support Contract and EOL/EOS management', url='https://github.com/dansheps/netbox-lifecycle/',