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:
@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user