summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-05 18:30:24 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-05 18:31:52 +0200
commit7fb1ff25e2491e94c3446a401e644de9793006f5 (patch)
tree54a97773eef1b633895480a8b8caeb768bf7b43a /archaeological_context_records/models.py
parentd3d84ed7cc5ff3cb9c164838c78cfcee73fbc44e (diff)
downloadIshtar-7fb1ff25e2491e94c3446a401e644de9793006f5.tar.bz2
Ishtar-7fb1ff25e2491e94c3446a401e644de9793006f5.zip
Add images for operation, context records and sources (refs #2927, refs #351)
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index f2a802fbe..34204ebfa 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -26,7 +26,8 @@ from django.utils.translation import ugettext_lazy as _, ugettext, pgettext
from ishtar_common.models import GeneralType, BaseHistorizedItem, \
HistoricalRecords, OwnPerms, ShortMenuItem, Source, GeneralRelationType,\
- GeneralRecordRelations, post_delete_record_relation, get_external_id
+ GeneralRecordRelations, post_delete_record_relation, get_external_id, \
+ ImageModel
from archaeological_operations.models import Operation, Period, Parcel
@@ -105,7 +106,7 @@ class IdentificationType(GeneralType):
return self.label
-class ContextRecord(BaseHistorizedItem, OwnPerms, ShortMenuItem):
+class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
SHOW_URL = 'show-contextrecord'
TABLE_COLS = ['parcel.town', 'operation.year',
'operation.operation_code',
@@ -120,6 +121,7 @@ class ContextRecord(BaseHistorizedItem, OwnPerms, ShortMenuItem):
'related_context_records': 'detailled_related_context_records'
}
}
+ IMAGE_PREFIX = 'context_records/'
external_id = models.TextField(_(u"External ID"), blank=True, null=True)
auto_external_id = models.BooleanField(
_(u"External ID is set automatically"), default=False)