1
0
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:
Jeremy Stretch
2016-06-24 11:16:49 -04:00
parent 9de8ac91a1
commit 39330850b3
6 changed files with 42 additions and 57 deletions

View File

@@ -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})