summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r--archaeological_finds/models_treatments.py36
1 files changed, 16 insertions, 20 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 04747e3a1..eb149b0de 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -172,6 +172,7 @@ class Treatment(
HISTORICAL_M2M = [
"treatment_types",
]
+ NUMBER_FIELDS = ["year", "index"]
BASE_SEARCH_VECTORS = [
SearchVectorConfig("treatment_types__label"),
@@ -1037,6 +1038,12 @@ class TreatmentFile(
SearchVectorConfig("index"),
]
PARENT_SEARCH_VECTORS = ["in_charge", "applicant", "applicant_organisation"]
+ NUMBER_FIELDS = ["year", "index"]
+ DATED_FIELDS = BaseHistorizedItem.DATED_FIELDS + [
+ "end_date",
+ "exhibition_start_date",
+ "exhibition_end_date",
+ ]
EXTRA_REQUEST_KEYS = {
"in_charge__pk": "in_charge__pk", # used by dynamic_table_documents
@@ -1075,33 +1082,22 @@ class TreatmentFile(
"applicant_organisation__cached_label__iexact",
related_name="applicant_organisation"
),
- "exhibition_start_before": SearchAltName(
- pgettext_lazy("key for text search", "exhibition-start-before"),
- "exhibition_start_date__lte",
- ),
- "exhibition_start_after": SearchAltName(
- pgettext_lazy("key for text search", "exhibition-start-after"),
- "exhibition_start_date__gte",
+ "end_date": SearchAltName(
+ pgettext_lazy("key for text search", "end-date"),
+ "end_date",
),
- "exhibition_end_before": SearchAltName(
- pgettext_lazy("key for text search", "exhibition-end-before"),
- "exhibition_end_date__lte",
+ "exhibition_start": SearchAltName(
+ pgettext_lazy("key for text search", "exhibition-start"),
+ "exhibition_start_date",
),
- "exhibition_end_after": SearchAltName(
- pgettext_lazy("key for text search", "exhibition-end-after"),
- "exhibition_end_date__gte",
+ "exhibition_end": SearchAltName(
+ pgettext_lazy("key for text search", "exhibition-end"),
+ "exhibition_end_date",
),
}
ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES)
ALT_NAMES.update(DocumentItem.ALT_NAMES)
- DATED_FIELDS = BaseHistorizedItem.DATED_FIELDS + [
- "exhibition_start_date__lte",
- "exhibition_start_date__gte",
- "exhibition_end_date__lte",
- "exhibition_end_date__gte",
- ]
-
# fields
year = models.IntegerField(_("Year"), default=get_current_year)
index = models.IntegerField(_("Index"), default=1)