fixed 404 bug, added default ordering for some tables

This commit is contained in:
Hedde van der Heide
2022-03-28 11:07:33 +02:00
parent 51736942e7
commit f4188b957f
3 changed files with 13 additions and 2 deletions
-1
View File
@@ -55,7 +55,6 @@ class SoftwareProductVersion(PrimaryModel):
return reverse("plugins:netbox_slm:softwareproductversion", kwargs={"pk": self.pk})
def get_installation_count(self):
print("ACCESSED")
count = SoftwareProductInstallation.objects.filter(version_id=self.pk).count()
return safestring.mark_safe("<a href=\"{url}\">{count}</a>".format(
url=reverse_lazy("plugins:netbox_slm:softwareproductinstallation_list") + f"?q={self.name}",
+12
View File
@@ -37,6 +37,12 @@ class SoftwareProductTable(BaseTable):
"installations",
# "tags",
)
sequence = (
"manufacturer",
"name",
"description",
"installations",
)
class SoftwareProductVersionTable(BaseTable):
@@ -76,6 +82,12 @@ class SoftwareProductVersionTable(BaseTable):
"installations",
# "tags",
)
sequence = (
"manufacturer",
"software_product",
"name",
"installations",
)
class SoftwareProductInstallationTable(BaseTable):
+1 -1
View File
@@ -127,7 +127,7 @@ class SoftwareProductInstallationListView(generic.ObjectListView):
class SoftwareProductInstallationView(generic.ObjectView):
"""Display SoftwareProductInstallation details"""
queryset = SoftwareProductVersion.objects.all()
queryset = SoftwareProductInstallation.objects.all()
# def get_extra_context(self, request, instance):
# records = instance.record_set.all()