From 92e4fca329c8eb12d7aa081e658468648e63c188 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 2 Nov 2007 16:30:36 +0000
Subject: [PATCH] Make getWorklistListQuery return python-usable list instead
 of pre-preocessed select and group-by expressions.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17368 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/patches/WorkflowTool.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/product/ERP5Type/patches/WorkflowTool.py b/product/ERP5Type/patches/WorkflowTool.py
index b2ff0fbf43..d3e34af024 100644
--- a/product/ERP5Type/patches/WorkflowTool.py
+++ b/product/ERP5Type/patches/WorkflowTool.py
@@ -309,11 +309,8 @@ def getWorklistListQuery(grouped_worklist_dict):
   query = generateNestedQuery(priority_list=total_criterion_id_list,
                               criterion_dict=total_criterion_id_dict)
   assert query is not None
-  group_by_expression = ', '.join(total_criterion_id_list)
   assert COUNT_COLUMN_TITLE not in total_criterion_id_dict
-  select_expression = 'count(*) as %s, %s' % (COUNT_COLUMN_TITLE,
-                                              group_by_expression)
-  return (select_expression, group_by_expression, query)
+  return (total_criterion_id_list, query)
 
 def _ensemblistMultiply(ensemble_a, ensemble_b):
   """
@@ -489,8 +486,12 @@ def WorkflowTool_listActions(self, info=None, object=None):
             getSecurityUidListAndRoleColumnDict)
       for grouped_worklist_dict in worklist_list_grouped_by_condition:
         # Generate the query for this worklist_list
-        (select_expression, group_by_expression, query) = \
+        (total_criterion_id_list, query) = \
           getWorklistListQuery(grouped_worklist_dict=grouped_worklist_dict)
+        group_by_expression = ', '.join(total_criterion_id_list)
+        assert COUNT_COLUMN_TITLE not in total_criterion_id_list
+        select_expression = 'count(*) as %s, %s' % (COUNT_COLUMN_TITLE,
+                                                    group_by_expression)
         search_result_kw = {'select_expression': select_expression,
                             'group_by_expression': group_by_expression,
                             'query': query}
-- 
2.30.9