diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-05 18:19:06 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-05 18:19:06 +0100 |
commit | 9f8f172e7e18c9d8fffc5d973f269a50a975d34e (patch) | |
tree | f7a78b7b5c988c1c98e588a97eaf1e313ac0d23f /ishtar_common/views.py | |
parent | 6830c1ba33771fdecca15aeffded5b92aa88775c (diff) | |
download | Ishtar-9f8f172e7e18c9d8fffc5d973f269a50a975d34e.tar.bz2 Ishtar-9f8f172e7e18c9d8fffc5d973f269a50a975d34e.zip |
Better management of context record relations tables (refs #3347)
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r-- | ishtar_common/views.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py index d99e7f7ef..5f37a4dbf 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -768,7 +768,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[], alt_dct = dct.copy() alt_dct.pop(k) alt_dct.update(or_req) - query = query | Q(**alt_dct) + query |= Q(**alt_dct) for rtype_prefix in relation_types: vals = list(relation_types[rtype_prefix]) @@ -793,8 +793,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[], if not dct: # fake condition to trick Django (1.4): without it only the # alt_dct is managed - query = query & Q(pk__isnull=False) - query = query | Q(**alt_dct) + query &= Q(pk__isnull=False) + query |= Q(**alt_dct) for k, or_req in or_reqs: altor_dct = alt_dct.copy() altor_dct.pop(k) @@ -805,7 +805,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[], altor_dct[ rtype_prefix + 'right_relations__right_record__' + j] =\ val - query = query | Q(**altor_dct) + query |= Q(**altor_dct) if own: query = query & model.get_query_owns(request.user) |