[Erp5-report] r37112 yusei - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplate...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jul 15 06:58:06 CEST 2010


Author: yusei
Date: Thu Jul 15 06:58:03 2010
New Revision: 37112

URL: http://svn.erp5.org?rev=37112&view=rev
Log:
2010-07-15 yusei
* Fix a bug on CategoryTool_getPreferredPredicateCategoryParentUidItemList to support multimembership category list.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_getPreferredPredicateCategoryParentUidItemList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_getPreferredPredicateCategoryParentUidItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_getPreferredPredicateCategoryParentUidItemList.xml?rev=37112&r1=37111&r2=37112&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_getPreferredPredicateCategoryParentUidItemList.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_getPreferredPredicateCategoryParentUidItemList.xml [utf8] Thu Jul 15 06:58:03 2010
@@ -66,7 +66,11 @@ if not preferred_predicate_category_list
   return category_parent_uid_item_list\n
 \n
 # category_parent_uid_item_list structure is (category_uid, base_category_uid, category_strict_membership)\n
-category_parent_uid_item_dict = dict([(item[1], item) for item in category_parent_uid_item_list])\n
+category_parent_uid_item_dict = {}\n
+for category_uid, base_category_uid, category_strict_membership in category_parent_uid_item_list:\n
+  if not base_category_uid in category_parent_uid_item_dict:\n
+    category_parent_uid_item_dict[base_category_uid] = []\n
+  category_parent_uid_item_dict[base_category_uid].append([category_uid, base_category_uid, category_strict_membership])\n
 \n
 for base_category_id in preferred_predicate_category_list:\n
   base_category = getattr(context, base_category_id, None)\n
@@ -76,9 +80,12 @@ for base_category_id in preferred_predic
 \n
   if not base_category_uid in category_parent_uid_item_dict and base_category_id in enabled_base_category_list:\n
     # Add an empty record only if document does not have the category value and the category is enabled on the document.\n
-    category_parent_uid_item_dict[base_category_uid] = [0, base_category_uid, 1]\n
+    category_parent_uid_item_dict[base_category_uid] = [[0, base_category_uid, 1]]\n
 \n
-return category_parent_uid_item_dict.values()\n
+uid_item_list_list = category_parent_uid_item_dict.values()\n
+if uid_item_list_list:\n
+  return reduce(lambda a,b:a+b, uid_item_list_list)\n
+return ()\n
 </string> </value>
         </item>
         <item>
@@ -122,19 +129,19 @@ return category_parent_uid_item_dict.val
                             <string>context</string>
                             <string>preferred_predicate_category_list</string>
                             <string>category_parent_uid_item_list</string>
-                            <string>dict</string>
-                            <string>append</string>
-                            <string>$append0</string>
+                            <string>category_parent_uid_item_dict</string>
                             <string>_getiter_</string>
-                            <string>item</string>
+                            <string>category_uid</string>
+                            <string>base_category_uid</string>
+                            <string>category_strict_membership</string>
+                            <string>_write_</string>
                             <string>_getitem_</string>
-                            <string>category_parent_uid_item_dict</string>
                             <string>base_category_id</string>
                             <string>getattr</string>
                             <string>None</string>
                             <string>base_category</string>
-                            <string>base_category_uid</string>
-                            <string>_write_</string>
+                            <string>uid_item_list_list</string>
+                            <string>reduce</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log?rev=37112&r1=37111&r2=37112&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log [utf8] Thu Jul 15 06:58:03 2010
@@ -1,3 +1,6 @@
+2010-07-15 yusei
+* Fix a bug on CategoryTool_getPreferredPredicateCategoryParentUidItemList to support multimembership category list.
+
 2010-07-13 yusei
 * Support more than four dimensional matrix.
 

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=37112&r1=37111&r2=37112&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Thu Jul 15 06:58:03 2010
@@ -1 +1 @@
-1627
+1628
\ No newline at end of file




More information about the Erp5-report mailing list