summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-12-03 01:46:28 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-12-03 01:46:28 +0100
commit3399828d16f12caecf6eed8acd2869d5f20f1817 (patch)
treea17fbf56ae06fc3038abc22ccbfd1f15ada1f070 /archaeological_finds
parente7165c5915d5ecddf1248f0cbfb03e5efccd45a7 (diff)
downloadIshtar-3399828d16f12caecf6eed8acd2869d5f20f1817.tar.bz2
Ishtar-3399828d16f12caecf6eed8acd2869d5f20f1817.zip
Search: "today" keyword for dates with '-' and '+' days - add find criteria
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/forms.py5
-rw-r--r--archaeological_finds/models_finds.py6
2 files changed, 9 insertions, 2 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index 3019d4aa2..66f99d08b 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -883,8 +883,11 @@ class FindSelect(HistorySelect):
base_finds__batch = forms.ChoiceField(
label=_(u"Batch/object"), choices=[])
checked_type = forms.ChoiceField(label=_("Check"))
- loan = forms.NullBooleanField(label=_(u"Loan?"))
documents__image__isnull = forms.NullBooleanField(label=_(u"Has an image?"))
+ loan = forms.NullBooleanField(label=_(u"Loan?"))
+ treatments_file_end_date = forms.DateField(
+ label=_(u"Treatment file end date before"), widget=DatePicker
+ )
TYPES = [
FieldType('datings__period', Period),
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 08fb15f0e..3ee7d12c7 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -759,7 +759,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms,
'base_finds__context_record__',
}
- DATED_FIELDS = ['last_modified__gte']
+ DATED_FIELDS = ['last_modified__gte', 'treatments__file__end_date__lte']
BASE_REQUEST = {'downstream_treatment__isnull': True}
EXTRA_REQUEST_KEYS = {
'base_finds__context_record':
@@ -971,6 +971,10 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms,
'loan': (
pgettext_lazy("key for text search", u"loan"),
query_loan
+ ),
+ 'treatments_file_end_date': (
+ pgettext_lazy("key for text search", u"treatment-end-date-before"),
+ 'treatments__file__end_date__lte'
)
}
for v in ALT_NAMES.values():