diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/version.py | 4 | ||||
-rw-r--r-- | ishtar_common/views_item.py | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/ishtar_common/version.py b/ishtar_common/version.py index 786cae0aa..120c379b3 100644 --- a/ishtar_common/version.py +++ b/ishtar_common/version.py @@ -1,5 +1,5 @@ -# 3.1.9 -VERSION = (3, 1, 9) +# 3.1.10 +VERSION = (3, 1, 10) def get_version(): diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 9c20f7e2c..3787e7d19 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -1369,10 +1369,14 @@ def _get_data_from_query_old( splitted_k += ky.split("__") else: splitted_k.append(ky) + if splitted_k[-1] == "count": + splitted_k = splitted_k[:-2] + [splitted_k[-2] + "__count"] for ky in splitted_k: new_vals = [] for val in vals: - if hasattr(val, "all"): # manage related objects + if ky.endswith("__count"): + new_vals += [getattr(val, ky[:-len("__count")]).count()] + elif hasattr(val, "all"): # manage related objects val = list(val.all()) for v in val: v = getattr(v, ky) |