diff options
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index a8a06ae27..071d80af1 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -74,7 +74,11 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem, 'person__cached_label', 'start_date', 'downstream_cached_label', 'upstream_cached_label') - REVERSED_BOOL_FIELDS = ['documents__image__isnull'] + REVERSED_BOOL_FIELDS = [ + 'documents__image__isnull', + 'documents__associated_file__isnull', + 'documents__associated_url__isnull', + ] EXTRA_REQUEST_KEYS = { "downstream_cached_label": "downstream__cached_label", "upstream_cached_label": "upstream__cached_label", @@ -115,10 +119,6 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem, pgettext_lazy("key for text search", "index"), 'index' ), - 'documents__image__isnull': SearchAltName( - pgettext_lazy("key for text search", "has-image"), - 'documents__image__isnull' - ), 'treatment_types': SearchAltName( pgettext_lazy("key for text search", "type"), 'treatment_types__label__iexact' @@ -129,6 +129,7 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem, ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) + ALT_NAMES.update(DocumentItem.ALT_NAMES) HISTORICAL_M2M = [ 'treatment_types', ] @@ -914,6 +915,11 @@ class TreatmentFile(DashboardFormItem, ClosedItem, DocumentItem, "in_charge__pk": "in_charge__pk", # used by dynamic_table_documents "applicant__pk": "applicant__pk", # used by dynamic_table_documents } + REVERSED_BOOL_FIELDS = [ + 'documents__image__isnull', + 'documents__associated_file__isnull', + 'documents__associated_url__isnull', + ] # alternative names of fields for searches ALT_NAMES = { 'name': SearchAltName( @@ -966,6 +972,7 @@ class TreatmentFile(DashboardFormItem, ClosedItem, DocumentItem, ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) + ALT_NAMES.update(DocumentItem.ALT_NAMES) DATED_FIELDS = ['exhibition_start_date__lte', 'exhibition_start_date__gte', |