summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py13
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",