summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py19
1 files changed, 18 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)