summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCefin <kevon@tuta.io>2021-10-06 10:52:01 +0200
committerCefin <kevon@tuta.io>2021-10-13 10:57:40 +0200
commit4781a579ca551086cab9db79562343aa9717614d (patch)
tree8e34ad236ec5e6dbe8bf756eb62170f09f0cea66
parent55d4cd7cfc4970538e7df967a9c088ffed065376 (diff)
downloadIshtar-4781a579ca551086cab9db79562343aa9717614d.tar.bz2
Ishtar-4781a579ca551086cab9db79562343aa9717614d.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 50952d3a9..6a66e3dfb 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)