summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-05-10 12:50:17 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-05-10 13:13:26 +0200
commitde38bdf2e26f29be59a923363c6bc54e5b49e157 (patch)
tree07bb33b177f6c43aaef377d6b70be3c7f60d9b67 /archaeological_finds/models_finds.py
parent01a74292ba7a2bf6f62b924f686a3531a26b30e9 (diff)
downloadIshtar-de38bdf2e26f29be59a923363c6bc54e5b49e157.tar.bz2
Ishtar-de38bdf2e26f29be59a923363c6bc54e5b49e157.zip
🐛 table count - fix bad number of items count on finds with many associated context record (refs #5898)
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r--archaeological_finds/models_finds.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 375cfc366..aa92a93c4 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -1137,6 +1137,12 @@ class Find(
"base_finds__context_record__parcel",
]
NEW_QUERY_ENGINE = True
+ # if these fields are in the search query columns - add these keys for total count
+ QUERY_DISTINCT_COUNT = {
+ "base_finds__context_record__label": "base_finds__context_record__pk",
+ "base_finds__context_record__operation__code_patriarche": "base_finds__context_record__operation__pk",
+ "base_finds__context_record__operation__common_name": "base_finds__context_record__operation__pk",
+ }
COL_LABELS = {
"base_finds__context_record__label": _("Context record"),
"base_finds__cache_short_id": _("Base find - Short ID"),