From 447c972cf4f9f99c02434b96097d0e914d96056c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 26 Sep 2025 14:50:54 +0200 Subject: ✨ treatment search: add start and end date criteria MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_finds/forms_treatments.py | 2 ++ archaeological_finds/models_treatments.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index a15571a06..8122f75ad 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -70,6 +70,8 @@ class TreatmentSelect(DocumentItemSelect): label=_("Reference"), max_length=200, required=False) treatment_status = forms.ChoiceField(label=_("Status"), choices=[]) input_status = forms.ChoiceField(label=_("Input status"), choices=[]) + start_date = DateField(label=_("Start date")) + end_date = DateField(label=_("End date")) location = forms.IntegerField( label=_("Location"), widget=widgets.JQueryAutoComplete( diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 5e6e1ed98..faf448b63 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -293,6 +293,14 @@ class Treatment( pgettext_lazy("key for text search", "organization"), "organization__name__iexact", ), + "start_date": SearchAltName( + pgettext_lazy("key for text search", "start"), + "start_date", + ), + "end_date": SearchAltName( + pgettext_lazy("key for text search", "end"), + "end_date", + ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) ALT_NAMES.update(DocumentItem.ALT_NAMES) -- cgit v1.2.3