From 390c95c4cb2b88b384e335b2c465fc8622eded56 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 17 Jun 2019 16:06:15 +0200 Subject: Document search: has an image --- ishtar_common/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index d8cc862f6..a70399ba7 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -4781,9 +4781,16 @@ class Document(BaseHistorizedItem, OwnPerms, ImageModel, ValueGetter, MainItem): pgettext_lazy("key for text search", "warehouse"), 'warehouses__name__iexact' ), + 'image__isnull': + SearchAltName( + pgettext_lazy("key for text search", "has-image"), + 'image__isnull'), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) + # search parameters + REVERSED_BOOL_FIELDS = ['image__isnull'] + objects = ExternalIdManager() RELATIVE_SESSION_NAMES = [ ('find', 'finds__pk'), -- cgit v1.2.3