1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add UI views for export templates

This commit is contained in:
jeremystretch
2021-06-23 20:39:35 -04:00
parent 276ded0119
commit 10cbbee947
12 changed files with 288 additions and 41 deletions

View File

@ -171,6 +171,7 @@ class Webhook(BigIDModel):
# Custom links
#
@extras_features('webhooks')
class CustomLink(ChangeLoggedModel):
"""
A custom link to an external representation of a NetBox object. The link text and URL fields accept Jinja2 template
@ -229,7 +230,8 @@ class CustomLink(ChangeLoggedModel):
# Export templates
#
class ExportTemplate(BigIDModel):
@extras_features('webhooks')
class ExportTemplate(ChangeLoggedModel):
content_type = models.ForeignKey(
to=ContentType,
on_delete=models.CASCADE,
@ -272,6 +274,9 @@ class ExportTemplate(BigIDModel):
def __str__(self):
return f"{self.content_type}: {self.name}"
def get_absolute_url(self):
return reverse('extras:exporttemplate', args=[self.pk])
def clean(self):
super().clean()