summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r--archaeological_finds/models_finds.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 393583749..33ec2df0b 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -40,7 +40,7 @@ from ishtar_common.models import Document, GeneralType, \
HistoricalRecords, OwnPerms, Person, Basket, post_save_cache, \
ValueGetter, get_current_profile, IshtarSiteProfile, PRIVATE_FIELDS, \
SpatialReferenceSystem, BulkUpdatedItem, ExternalIdManager, QuickAction, \
- MainItem
+ MainItem, document_attached_changed
from archaeological_operations.models import AdministrativeAct, Operation
from archaeological_context_records.models import ContextRecord, Dating
@@ -1179,6 +1179,9 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms,
documents = models.ManyToManyField(
Document, related_name='finds', verbose_name=_(u"Documents"),
blank=True)
+ main_image = models.ForeignKey(
+ Document, related_name='main_image_finds',
+ verbose_name=_(u"Main image"), blank=True, null=True)
treatments = models.ManyToManyField(
"Treatment", verbose_name=_(u"Treatments"),
related_name='finds', blank=True,
@@ -1954,6 +1957,9 @@ def base_find_find_changed(sender, **kwargs):
m2m_changed.connect(base_find_find_changed, sender=Find.base_finds.through)
+m2m_changed.connect(document_attached_changed,
+ sender=Find.documents.through)
+
class Property(LightHistorizedItem):
find = models.ForeignKey(Find, verbose_name=_(u"Find"))