fixed 404 bug, added default ordering for some tables
This commit is contained in:
@@ -55,7 +55,6 @@ class SoftwareProductVersion(PrimaryModel):
|
|||||||
return reverse("plugins:netbox_slm:softwareproductversion", kwargs={"pk": self.pk})
|
return reverse("plugins:netbox_slm:softwareproductversion", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
def get_installation_count(self):
|
def get_installation_count(self):
|
||||||
print("ACCESSED")
|
|
||||||
count = SoftwareProductInstallation.objects.filter(version_id=self.pk).count()
|
count = SoftwareProductInstallation.objects.filter(version_id=self.pk).count()
|
||||||
return safestring.mark_safe("<a href=\"{url}\">{count}</a>".format(
|
return safestring.mark_safe("<a href=\"{url}\">{count}</a>".format(
|
||||||
url=reverse_lazy("plugins:netbox_slm:softwareproductinstallation_list") + f"?q={self.name}",
|
url=reverse_lazy("plugins:netbox_slm:softwareproductinstallation_list") + f"?q={self.name}",
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ class SoftwareProductTable(BaseTable):
|
|||||||
"installations",
|
"installations",
|
||||||
# "tags",
|
# "tags",
|
||||||
)
|
)
|
||||||
|
sequence = (
|
||||||
|
"manufacturer",
|
||||||
|
"name",
|
||||||
|
"description",
|
||||||
|
"installations",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SoftwareProductVersionTable(BaseTable):
|
class SoftwareProductVersionTable(BaseTable):
|
||||||
@@ -76,6 +82,12 @@ class SoftwareProductVersionTable(BaseTable):
|
|||||||
"installations",
|
"installations",
|
||||||
# "tags",
|
# "tags",
|
||||||
)
|
)
|
||||||
|
sequence = (
|
||||||
|
"manufacturer",
|
||||||
|
"software_product",
|
||||||
|
"name",
|
||||||
|
"installations",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SoftwareProductInstallationTable(BaseTable):
|
class SoftwareProductInstallationTable(BaseTable):
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class SoftwareProductInstallationListView(generic.ObjectListView):
|
|||||||
class SoftwareProductInstallationView(generic.ObjectView):
|
class SoftwareProductInstallationView(generic.ObjectView):
|
||||||
"""Display SoftwareProductInstallation details"""
|
"""Display SoftwareProductInstallation details"""
|
||||||
|
|
||||||
queryset = SoftwareProductVersion.objects.all()
|
queryset = SoftwareProductInstallation.objects.all()
|
||||||
|
|
||||||
# def get_extra_context(self, request, instance):
|
# def get_extra_context(self, request, instance):
|
||||||
# records = instance.record_set.all()
|
# records = instance.record_set.all()
|
||||||
|
|||||||
Reference in New Issue
Block a user