[Erp5-report] r22985 - /erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 13 18:23:39 CEST 2008


Author: vincent
Date: Wed Aug 13 18:23:36 2008
New Revision: 22985

URL: http://svn.erp5.org?rev=22985&view=rev
Log:
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.

Modified:
    erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=22985&r1=22984&r2=22985&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py Wed Aug 13 18:23:36 2008
@@ -1833,12 +1833,9 @@
           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)




More information about the Erp5-report mailing list