From e131856e48cc4644443c62f3f826fa451cb7e66b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 2 Nov 2022 16:03:26 +0100 Subject: Geodata - search: add search fields on related items searches --- archaeological_finds/forms.py | 6 +++--- archaeological_finds/models_finds.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'archaeological_finds') diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index fc1816d32..5a6e066ea 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -90,7 +90,7 @@ from ishtar_common.forms import ( QAForm, MultiSearchForm, LockForm, - DocumentItemSelect, + GeoItemSelect, ) from ishtar_common.forms_common import get_town_field from archaeological_context_records.forms import PeriodSelect @@ -1277,7 +1277,7 @@ DatingFormSet.form_admin_name = _("Find - 040 - Dating") DatingFormSet.form_slug = "find-040-dating" -class FindSelect(DocumentItemSelect, PeriodSelect): +class FindSelect(GeoItemSelect, PeriodSelect): _model = models.Find form_admin_name = _("Find - 001 - Search") form_slug = "find-001-search" @@ -1646,7 +1646,7 @@ class FindSelect(DocumentItemSelect, PeriodSelect): FieldType("alteration_causes", models.AlterationCauseType), FieldType("treatment_emergency", models.TreatmentEmergencyType), FieldType("cultural_attributions", CulturalAttributionType), - ] + ] + GeoItemSelect.TYPES SITE_KEYS = { "archaeological_sites": "attached-to-operation", "archaeological_sites_name": "name-attached-to-operation", diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index d53f45fdb..04af22d21 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -65,6 +65,7 @@ from ishtar_common.models import ( CompleteIdentifierItem, SearchVectorConfig, DocumentItem, + GeoItem ) from ishtar_common.models_common import HistoricalRecords, SerializeItem, \ GeoVectorData, geodata_attached_changed @@ -1624,6 +1625,7 @@ class Find( ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) ALT_NAMES.update(DocumentItem.ALT_NAMES) ALT_NAMES.update(Dating.ASSOCIATED_ALT_NAMES) + ALT_NAMES.update(GeoItem.ALT_NAMES_FOR_FIND()) """ # kept as an example -- cgit v1.2.3