summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
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, ''])