Commit 6f30ef42 authored by Vincent Pelletier's avatar Vincent Pelletier

Comment was not quite right: actualy, giving a kw simply means we are passing...

Comment was not quite right: actualy, giving a kw simply means we are passing Query contructor parameters directly, wich not only involves column names.
Simplify code to make this obvious.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22985 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1ecfc061
......@@ -1833,12 +1833,9 @@ class Catalog(Folder,
if hasattr(current_query, 'order_by'): query_group_by_list = current_query.order_by
else:
if isinstance(value, dict):
# XXX: If dictionary has more that one key, subsequent Query() will raise.
for value_key in value.keys():
if value_key == 'query':
new_query_dict[key] = value['query']
else:
new_query_dict[value_key] = value[value_key]
new_query_dict = value.copy()
if 'query' in new_query_dict:
new_query_dict[key] = new_query_dict.pop('query')
else:
new_query_dict[key] = value
current_query = Query(**new_query_dict)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment