[Erp5-report] r33274 nicolas - in /erp5/trunk/bt5/erp5_data_protection: ExtensionTemplateIt...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 2 13:10:06 CET 2010


Author: nicolas
Date: Tue Mar  2 13:10:04 2010
New Revision: 33274

URL: http://svn.erp5.org?rev=33274&view=rev
Log:
Use portal_actions to get the filtered list of actions.
enhance performance by using cacheable result

Modified:
    erp5/trunk/bt5/erp5_data_protection/ExtensionTemplateItem/DataProtectionRequestUtils.py
    erp5/trunk/bt5/erp5_data_protection/bt/revision

Modified: erp5/trunk/bt5/erp5_data_protection/ExtensionTemplateItem/DataProtectionRequestUtils.py
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_data_protection/ExtensionTemplateItem/DataProtectionRequestUtils.py?rev=33274&r1=33273&r2=33274&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_data_protection/ExtensionTemplateItem/DataProtectionRequestUtils.py [utf8] (original)
+++ erp5/trunk/bt5/erp5_data_protection/ExtensionTemplateItem/DataProtectionRequestUtils.py [utf8] Tue Mar  2 13:10:04 2010
@@ -27,7 +27,6 @@
 #
 ##############################################################################
 
-from Products.ERP5Type.Utils import createExpressionContext
 from Products.ERP5Form.FormBox import FormBox
 from urlparse import urlparse
 
@@ -52,15 +51,10 @@
         return label
   portal = self.getPortalObject()
   result_list = []
-  portal_type = self.getPortalType()
-  portal_type_object = portal.portal_types[portal_type]
-  action_view_url_list = [action.getAction() for action in \
-                                portal_type_object.getActionInformationList() \
-                                if 'view' in action.getActionType()]
-  action_url_list = [action_view_url(createExpressionContext(self))\
-                                   for action_view_url in action_view_url_list]
-  form_id_list = [urlparse(action_url)[2].split('/')[-1] \
-                                             for action_url in action_url_list]
+  action_list_dict = portal.portal_actions.listFilteredActionsFor(self)
+  action_list = action_list_dict.get('object_view', ())
+  form_id_list = [urlparse(action['url'])[2].split('/')[-1] \
+                                             for action in action_list]
   for property_map in property_map_list:
     label = None
     for form_id in form_id_list:

Modified: erp5/trunk/bt5/erp5_data_protection/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_data_protection/bt/revision?rev=33274&r1=33273&r2=33274&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_data_protection/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_data_protection/bt/revision [utf8] Tue Mar  2 13:10:04 2010
@@ -1,1 +1,1 @@
-12
+15




More information about the Erp5-report mailing list