summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-10-06 15:08:00 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:23:18 +0100
commitf962ebab43441a1286fa17d882a0935720bb560c (patch)
tree244d0a52b1253e2580ab25d71dcb4d0f84f141fc /archaeological_operations/models.py
parent8d5a3dab0263aa1a6ceae34254bbf4aaffd2087a (diff)
downloadIshtar-f962ebab43441a1286fa17d882a0935720bb560c.tar.bz2
Ishtar-f962ebab43441a1286fa17d882a0935720bb560c.zip
Geodata: cascade add
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 13b784539..7ba14a786 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -75,7 +75,8 @@ from ishtar_common.models import (
MainItem,
HierarchicalType,
)
-from ishtar_common.models_common import Department, GeoVectorData, HistoricalRecords
+from ishtar_common.models_common import Department, GeoVectorData, HistoricalRecords,\
+ geodata_attached_changed
from ishtar_common.model_managers import UUIDModelManager
from ishtar_common.utils import (
cached_label_changed,
@@ -779,6 +780,7 @@ post_save.connect(site_post_save, sender=ArchaeologicalSite)
m2m_changed.connect(
document_attached_changed, sender=ArchaeologicalSite.documents.through
)
+m2m_changed.connect(geodata_attached_changed, sender=ArchaeologicalSite.geodata.through)
for attr in ArchaeologicalSite.HISTORICAL_M2M:
m2m_changed.connect(
@@ -976,12 +978,11 @@ class Operation(
"code_patriarche": "Code patriarche",
"associated_file_short_label": _("Associated file (label)"),
"operator__name": _("Operator name"),
- "scientist__raw_name": _("Scientist (full name)"),
"associated_file__external_id": _("Associated file (external ID)"),
"scientist__title": _("Scientist (title)"),
"scientist__surname": _("Scientist (surname)"),
"scientist__name": _("Scientist (name)"),
- "scientist__raw_name": _("Scientist in charge"),
+ "scientist__raw_name": _("Scientist (full name)"),
"scientist__attached_to__name": _("Scientist - Organization (name)"),
"in_charge__title": _("Scientific monitor (title)"),
"in_charge__surname": _("Scientific monitor (surname)"),
@@ -1516,6 +1517,9 @@ class Operation(
def __str__(self):
return self.cached_label or ""
+ def geodata_child_item_queries(self):
+ return [self.context_record]
+
DOC_VALUES = [
("context_records", _("List of associated context records")),
("containers", _("List of associated containers")),
@@ -2205,6 +2209,7 @@ class Operation(
m2m_changed.connect(force_cached_label_changed, sender=Operation.towns.through)
m2m_changed.connect(document_attached_changed, sender=Operation.documents.through)
+m2m_changed.connect(geodata_attached_changed, sender=Operation.geodata.through)
for attr in Operation.HISTORICAL_M2M:
m2m_changed.connect(