wip installation model

This commit is contained in:
Hedde van der Heide
2021-12-08 15:36:47 +01:00
parent 76b0dd2c5d
commit 92a1a58eb0
12 changed files with 430 additions and 19 deletions
+32
View File
@@ -44,3 +44,35 @@ class SoftwareProductVersion(PrimaryModel):
def get_absolute_url(self):
return reverse("plugins:netbox_slm:softwareproductversion", kwargs={"pk": self.pk})
# @extras_features('custom_fields', 'custom_links', 'export_templates', 'tags', 'webhooks')
class SoftwareProductInstallation(PrimaryModel):
device = models.ForeignKey(
to='dcim.Device',
on_delete=models.PROTECT,
related_name='softwareproduct_installations'
)
# virtualmachine = models.ForeignKey(
# to='virtualization.VirtualMachine',
# on_delete=models.PROTECT,
# related_name='softwareproduct_installations'
# )
software_product = models.ForeignKey(
to='netbox_slm.SoftwareProduct',
on_delete=models.PROTECT,
related_name='software_products'
)
version = models.ForeignKey(
to='netbox_slm.SoftwareProductVersion',
on_delete=models.PROTECT,
related_name='softwareproduct_versions'
)
objects = RestrictedQuerySet.as_manager()
def __str__(self):
return f"{self.pk}"
def get_absolute_url(self):
return reverse("plugins:netbox_slm:softwareproductinstallation", kwargs={"pk": self.pk})