summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-09-26 14:50:54 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-09-29 17:53:56 +0200
commit447c972cf4f9f99c02434b96097d0e914d96056c (patch)
treeb2766839a2fff173d4a7e94ece618bb798ccd100
parent2828a7ff52a5772b430e2c5af5603a1be15ece0b (diff)
downloadIshtar-447c972cf4f9f99c02434b96097d0e914d96056c.tar.bz2
Ishtar-447c972cf4f9f99c02434b96097d0e914d96056c.zip
✨ treatment search: add start and end date criteria
-rw-r--r--archaeological_finds/forms_treatments.py2
-rw-r--r--archaeological_finds/models_treatments.py8
2 files changed, 10 insertions, 0 deletions
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)