summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py19
-rw-r--r--ishtar_common/views.py1
2 files changed, 19 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index cbf1431a7..4d8243af4 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -62,7 +62,8 @@ from simple_history.models import HistoricalRecords as BaseHistoricalRecords
from ishtar_common.model_merging import merge_model_objects
from ishtar_common.utils import get_cache, disable_for_loaddata, create_slug,\
- get_all_field_names, merge_tsvectors, cached_label_changed
+ get_all_field_names, merge_tsvectors, cached_label_changed, \
+ generate_relation_graph
from ishtar_common.models_imports import ImporterModel, ImporterType, \
ImporterDefault, ImporterDefaultValues, ImporterColumn, \
@@ -984,6 +985,22 @@ class BulkUpdatedItem(object):
return transaction_id, False
+class RelationItem(models.Model):
+ """
+ Items with relation between them
+ """
+ relation_image = models.FileField(
+ _(u"Generated relation image (SVG)"), null=True, blank=True,
+ upload_to=get_image_path
+ )
+
+ class Meta:
+ abstract = True
+
+ def generate_relation_image(self):
+ generate_relation_graph(self)
+
+
class JsonDataSection(models.Model):
content_type = models.ForeignKey(ContentType)
name = models.CharField(_(u"Name"), max_length=200)
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 945d4764c..f6468afd0 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1353,6 +1353,7 @@ def show_item(model, name, extra_dct=None):
).split('/')[:-2]) + u"/"
dct['CURRENCY'] = get_current_profile().currency
dct['ENCODING'] = settings.ENCODING
+ dct['DOT_GENERATION'] = settings.DOT_BINARY and True
dct['current_window_url'] = url_name
date = None
if 'date' in dct: