summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-08-30 17:49:23 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:23:18 +0100
commitcd6769ddb29a86226c564a953a5a3f9e5bf719d4 (patch)
treee5b754cef2aa2b00739f68dd6ef1bba8f37bef8a /archaeological_warehouse/models.py
parent25e09e6744c239bdfa162fb3c46ac4ec938ae488 (diff)
downloadIshtar-cd6769ddb29a86226c564a953a5a3f9e5bf719d4.tar.bz2
Ishtar-cd6769ddb29a86226c564a953a5a3f9e5bf719d4.zip
Fix many count search such has "has-finds" (refs #5425)
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index 2e2aae732..9a8bc86c2 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -1004,7 +1004,8 @@ class Container(
pgettext_lazy("key for text search", "find-description"),
"finds__description__iexact",
),
- "empty": SearchAltName(pgettext_lazy("key for text search", "empty"), "finds"),
+ "empty": SearchAltName(pgettext_lazy("key for text search", "empty"),
+ "finds__isnull"),
"parent": SearchAltName(
pgettext_lazy("key for text search", "parent-container"),
"parent__cached_label__iexact",
@@ -1025,7 +1026,7 @@ class Container(
"documents__associated_url__isnull",
]
BOOL_FIELDS = LightHistorizedItem.BOOL_FIELDS + ["container_type__stationary"]
- REVERSED_MANY_COUNTED_FIELDS = ["finds", "finds_ref"]
+ REVERSED_MANY_COUNTED_FIELDS = ["finds__isnull", "finds_ref"]
ALT_NAMES.update(LightHistorizedItem.ALT_NAMES)
ALT_NAMES.update(DocumentItem.ALT_NAMES)