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 | 3fd126b25be6a50c49b4525941d216fa92f727b0 (patch) | |
tree | c248b4e8b129d017373af2a07d399f5ca82717b1 /archaeological_operations/models.py | |
parent | 9429df335283ff6de8c0e21778bb0e7fbda6b149 (diff) | |
download | Ishtar-3fd126b25be6a50c49b4525941d216fa92f727b0.tar.bz2 Ishtar-3fd126b25be6a50c49b4525941d216fa92f727b0.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", |