summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-04-30 15:21:25 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-12 08:43:58 +0200
commitee1551b414158380c32b3e0410ba936eb1346812 (patch)
tree8ea4879f9ba3a6a926681b60c5fa15eb97bd941b /archaeological_context_records/models.py
parent966b18821a367e3fdcfb7639e7a7019628a937e7 (diff)
downloadIshtar-ee1551b414158380c32b3e0410ba936eb1346812.tar.bz2
Ishtar-ee1551b414158380c32b3e0410ba936eb1346812.zip
Relation graph: add logical fields in relations
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 07429e606..a3dcd5761 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -32,7 +32,7 @@ from ishtar_common.utils import cached_label_changed
from ishtar_common.models import GeneralType, BaseHistorizedItem, \
HistoricalRecords, OwnPerms, ShortMenuItem, Source, GeneralRelationType,\
- GeneralRecordRelations, post_delete_record_relation, \
+ GeneralRecordRelations, post_delete_record_relation, get_image_path, \
ImageModel, post_save_cache, ValueGetter, BulkUpdatedItem, IshtarImage
from archaeological_operations.models import Operation, Period, Parcel, \
ArchaeologicalSite
@@ -326,6 +326,10 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
blank=True)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
+ relation_image = models.FileField(
+ _(u"Generated relation image (SVG)"), null=True, blank=True,
+ upload_to=get_image_path
+ )
PARENT_SEARCH_VECTORS = ['operation']
BASE_SEARCH_VECTORS = ["cached_label", "label", "location",
"interpretation", "filling", "datings_comment",
@@ -424,6 +428,10 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
self.operation.get_reference(), self.parcel, self.label] if item])
@property
+ def relation_label(self):
+ return self.label
+
+ @property
def show_url(self):
return reverse('show-contextrecord', args=[self.pk, ''])