From da01f74f52ed9cae686b688f0117de5a65041300 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 13 Feb 2024 17:31:04 +0100 Subject: 🗃️ Context record - add cultural attribution field (refs #5740) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_context_records/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'archaeological_context_records/models.py') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 63f15eb86..832d496cd 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -70,10 +70,11 @@ from ishtar_common.models import ( from ishtar_common.models_common import GeoVectorData, HistoricalRecords,\ SerializeItem, geodata_attached_changed from archaeological_operations.models import ( + ArchaeologicalSite, + CulturalAttributionType, Operation, Period, Parcel, - ArchaeologicalSite, ) from ishtar_common.model_managers import UUIDModelManager @@ -615,6 +616,10 @@ class ContextRecord( pgettext_lazy("key for text search", "excavation-technique"), "excavation_technics__label__iexact", ), + "cultural_attributions": SearchAltName( + pgettext_lazy("key for text search", "cultural-attribution"), + "cultural_attributions__label__iexact", + ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) ALT_NAMES.update(DocumentItem.ALT_NAMES) @@ -760,6 +765,9 @@ class ContextRecord( ) filling = models.TextField(_("Filling"), blank=True, default="") interpretation = models.TextField(_("Interpretation"), blank=True, default="") + cultural_attributions = models.ManyToManyField( + CulturalAttributionType, verbose_name=_("Cultural attribution"), blank=True + ) taq = models.IntegerField( _("TAQ"), blank=True, -- cgit v1.2.3