summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCefin <kevon@tuta.io>2021-10-06 10:52:01 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-08 09:58:48 +0200
commitc31968cbdd4ff96c237c0835cca09b0d0dbba702 (patch)
tree4e9a081fb7ceaa39bd1592286c294b9dd620e68f
parentc9edc4af86bade1285ee4143b8aa681f8b553c16 (diff)
downloadIshtar-c31968cbdd4ff96c237c0835cca09b0d0dbba702.tar.bz2
Ishtar-c31968cbdd4ff96c237c0835cca09b0d0dbba702.zip
adding excavation technique field on search
-rw-r--r--archaeological_context_records/forms.py2
-rw-r--r--archaeological_context_records/models.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py
index 409ed0864..6d48aba4f 100644
--- a/archaeological_context_records/forms.py
+++ b/archaeological_context_records/forms.py
@@ -168,11 +168,13 @@ class RecordSelect(DocumentItemSelect, PeriodSelect):
cr_relation_types = forms.ChoiceField(
label=_("Search within relations"), choices=[]
)
+ excavation_technic = forms.ChoiceField(label=_("Excavation technique"), choices=[])
TYPES = PeriodSelect.TYPES + [
FieldType("unit", models.Unit),
FieldType("cr_relation_types", models.RelationType),
FieldType("ope_relation_types", OpeRelationType),
+ FieldType("excavation_technic", models.ExcavationTechnicType),
]
SITE_KEYS = {"archaeological_site": None}
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index db45418b7..aebee6d5f 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -542,6 +542,9 @@ class ContextRecord(
pgettext_lazy("key for text search", "record-relation-type"),
"cr_relation_types",
),
+ "excavation_technic": SearchAltName(
+ pgettext_lazy("key for text search", "excavation-technic"), "excavation_technic__label__iexact"
+ ),
}
ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES)
ALT_NAMES.update(DocumentItem.ALT_NAMES)