fixed installation ordering issue with field methods

This commit is contained in:
Hedde van der Heide
2022-04-14 11:35:25 +02:00
parent 74d648b94d
commit a02acbc561
4 changed files with 10 additions and 3 deletions
-1
View File
@@ -96,7 +96,6 @@ Steps
$ git clone https://github.com/netbox-community/netbox
$ cd netbox
$ git checkout f5356b8 (to pin 3.0.9)
install the virtual environment
+1 -1
View File
@@ -5,7 +5,7 @@ class SLMConfig(PluginConfig):
name = 'netbox_slm'
verbose_name = 'Software Lifecycle Management'
description = 'Software Lifecycle Management'
version = '0.95'
version = '0.96'
author = 'Hedde van der Heide'
author_email = 'hedde.vanderheide@ictu.nl'
base_url = 'slm'
+8
View File
@@ -142,5 +142,13 @@ class SoftwareProductInstallationTable(NetBoxTable):
"tags",
)
def order_platform(self, queryset, is_descending):
queryset = queryset.order_by(("device" if is_descending else "virtualmachine"))
return queryset, True
def order_type(self, queryset, is_descending):
queryset = queryset.order_by(("device" if is_descending else "virtualmachine"))
return queryset, True
def render_software_product(self, value, **kwargs):
return f"{kwargs['record'].software_product.manufacturer.name} - {value}"
+1 -1
View File
@@ -1,6 +1,6 @@
[metadata]
name = netbox-slm
version = 0.95
version = 0.96
description = Software Lifecycle Management Netbox Plugin.
# long_description = file: README.rst
# long_description_content_type='text/x-rst'