diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-11 13:27:04 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-11 13:27:04 +0100 |
commit | c9b07622ebf6f6dcceff3d6906d3ed33d74f24fd (patch) | |
tree | c248b4e8b129d017373af2a07d399f5ca82717b1 /archaeological_operations/models.py | |
parent | df67b2c757e813512a6e5f1ea31f8a4693444013 (diff) | |
download | Ishtar-c9b07622ebf6f6dcceff3d6906d3ed33d74f24fd.tar.bz2 Ishtar-c9b07622ebf6f6dcceff3d6906d3ed33d74f24fd.zip |
Searc criteria: add has image/file/url criteria for all document items
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 8dd6568b8..8a415c0c5 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -180,6 +180,11 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem, } # alternative names of fields for searches + REVERSED_BOOL_FIELDS = [ + 'documents__image__isnull', + 'documents__associated_file__isnull', + 'documents__associated_url__isnull', + ] ALT_NAMES = { 'reference': SearchAltName( pgettext_lazy("key for text search", "reference"), @@ -264,6 +269,7 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem, ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) + ALT_NAMES.update(DocumentItem.ALT_NAMES) UP_MODEL_QUERY = { "operation": (pgettext_lazy("key for text search", "operation"), @@ -694,6 +700,11 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, QRCodeItem, # search parameters BOOL_FIELDS = ['end_date__isnull', 'virtual_operation', 'documentation_received', 'finds_received'] + REVERSED_BOOL_FIELDS = [ + 'documents__image__isnull', + 'documents__associated_file__isnull', + 'documents__associated_url__isnull', + ] DATED_FIELDS = [ 'start_date__lte', 'start_date__gte', 'excavation_end_date__lte', 'excavation_end_date__gte', 'documentation_deadline__lte', @@ -951,6 +962,8 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, QRCodeItem, ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) + ALT_NAMES.update(DocumentItem.ALT_NAMES) + QA_EDIT = QuickAction( url="operation-qa-bulk-update", icon_class="fa fa-pencil", text=_(u"Bulk update"), target="many", |