mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Standardized graph display; added templatization for graph links
This commit is contained in:
@@ -56,6 +56,12 @@ class Graph(models.Model):
|
||||
template = Template(self.source)
|
||||
return template.render(Context({'obj': obj}))
|
||||
|
||||
def embed_link(self, obj):
|
||||
if self.link is None:
|
||||
return ''
|
||||
template = Template(self.link)
|
||||
return template.render(Context({'obj': obj}))
|
||||
|
||||
|
||||
class ExportTemplate(models.Model):
|
||||
content_type = models.ForeignKey(ContentType, limit_choices_to={'model__in': EXPORTTEMPLATE_MODELS})
|
||||
|
Reference in New Issue
Block a user