diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2013-04-16 21:53:17 +0000 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2013-04-16 21:53:17 +0000 |
| commit | a48d37badc463c1a4e496f9007d29257718a48dc (patch) | |
| tree | 18e9460122640484df04be868a1d422fe4ddffe3 /ishtar_common/views.py | |
| parent | 12ac381ca07632f2454b53fcddec02b1d7427604 (diff) | |
| parent | 82ecdb8c53d51a68b2a0b8fd35e14069ffd8540d (diff) | |
| download | Ishtar-a48d37badc463c1a4e496f9007d29257718a48dc.tar.bz2 Ishtar-a48d37badc463c1a4e496f9007d29257718a48dc.zip | |
Merge branch 'master' of lysithea.proxience.net:/home/proxience/git/ishtar
Diffstat (limited to 'ishtar_common/views.py')
| -rw-r--r-- | ishtar_common/views.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 42e826103..346edc0d7 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -229,7 +229,17 @@ def get_item(model, func_name, default_name, extra_request_keys=[], or_reqs = [] for req in dct.copy(): for k_hr in HIERARCHIC_FIELDS: - if req.endswith(k_hr + '__pk'): + if type(req) in (list, tuple): + val = dct.pop(req) + q = None + for idx, r in enumerate(req): + if not idx: + q = Q(**{r:val}) + else: + q = q | Q(**{r:val}) + or_reqs.append(q) + break + elif req.endswith(k_hr + '__pk'): val = dct.pop(req) reqs = Q(**{req:val}) req = req[:-2] + '__' |
