diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-20 18:42:36 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-20 18:42:36 +0200 |
commit | 521b2c11e07bcd373275ddf918e523fcdac8be03 (patch) | |
tree | 01493b511c1b598a41c2ca4dd6630e25124a1e4b /ishtar_common/views_item.py | |
parent | 193fbc5831e470f0eb169affa233c999f9d5f192 (diff) | |
download | Ishtar-521b2c11e07bcd373275ddf918e523fcdac8be03.tar.bz2 Ishtar-521b2c11e07bcd373275ddf918e523fcdac8be03.zip |
Fix sorting on tables
Diffstat (limited to 'ishtar_common/views_item.py')
-rw-r--r-- | ishtar_common/views_item.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 1b6d1e724..374dc3927 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -1120,8 +1120,15 @@ def get_item(model, func_name, default_name, extra_request_keys=[], for k in ks: if k.endswith("__pk"): k = k[:-len("__pk")] + "__label" - if '__' in k: - k = k.split('__')[0] + if k.endswith("towns"): + k = k + "__cached_label" + if k.endswith("__icontains") or \ + k.endswith("__contains") or \ + k.endswith("__iexact") or \ + k.endswith("__exact"): + k = '__'.join(k.split('__')[:-1]) + # if '__' in k: + # k = k.split('__')[0] orders.append(signe + k) else: # not a standard request key |