diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-09-02 08:38:11 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-09-02 08:38:11 +0200 |
commit | 7425ac6cb4b08a2933805b0de4594a2efbeacb32 (patch) | |
tree | eff63a9fcd55836d7c19ca2261a012482061758b /archaeological_context_records | |
parent | 7e7f4b81a8d7ec665c8945ef2ef26c9d5f13a66d (diff) | |
download | Ishtar-7425ac6cb4b08a2933805b0de4594a2efbeacb32.tar.bz2 Ishtar-7425ac6cb4b08a2933805b0de4594a2efbeacb32.zip |
Search - criteria: "has finds" for operation and context record search
Diffstat (limited to 'archaeological_context_records')
-rw-r--r-- | archaeological_context_records/forms.py | 1 | ||||
-rw-r--r-- | archaeological_context_records/models.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 91c2fdf63..19df6aecc 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -133,6 +133,7 @@ class RecordSelect(DocumentItemSelect, PeriodSelect): label=_(u"Search within related operations"), choices=[]) unit = forms.ChoiceField(label=_(u"Unit type"), choices=[]) parcel = forms.CharField(label=_(u"Parcel")) + has_finds = forms.NullBooleanField(label=_("Has finds")) cr_relation_types = forms.ChoiceField( label=_(u"Search within relations"), choices=[]) diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 84e2b3542..5e08ce6ae 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -400,6 +400,7 @@ class ContextRecord(BulkUpdatedItem, DocumentItem, BaseHistorizedItem, 'operation_id': 'operation_id', 'unit__label': "unit__label" } + MANY_COUNTED_FIELDS = ['base_finds'] REVERSED_BOOL_FIELDS = [ 'documents__image__isnull', 'documents__associated_file__isnull', @@ -453,6 +454,10 @@ class ContextRecord(BulkUpdatedItem, DocumentItem, BaseHistorizedItem, pgettext_lazy("key for text search", "parcel"), 'parcel__cached_label__iexact' ), + 'has_finds': SearchAltName( + pgettext_lazy("key for text search", "has-finds"), + 'base_finds' + ), 'cr_relation_types': SearchAltName( pgettext_lazy("key for text search", "record-relation-type"), 'cr_relation_types' |