[Erp5-report] r27100 - /erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 22 15:16:47 CEST 2009


Author: jerome
Date: Fri May 22 15:16:46 2009
New Revision: 27100

URL: http://svn.erp5.org?rev=27100&view=rev
Log:
normalize Item_get*Value and Item_get*Title scripts, all now use getCurrentTrackingList (until the expected behaviour is properly defined)
Item_getCurrentSiteTitle no longer accepts with_title=0 to return the site value. callers have been updated

Added:
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerValue.xml
Modified:
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/ItemModule_createDeliveryLine.xml
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_createDeliveryLine.xml
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerTitle.xml
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteTitle.xml
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteValue.xml
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceTitle.xml
    erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceValue.xml

Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/ItemModule_createDeliveryLine.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/ItemModule_createDeliveryLine.xml?rev=27100&r1=27099&r2=27100&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/ItemModule_createDeliveryLine.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/ItemModule_createDeliveryLine.xml [utf8] Fri May 22 15:16:46 2009
@@ -71,7 +71,7 @@
 else:\n
   object_list = stool.callSelectionFor(selection_name)\n
 \n
-source_section_list = [  item.Item_getCurrentOwnerTitle(with_title=0) for item in object_list ]\n
+source_section_list = [  item.Item_getCurrentOwnerValue() for item in object_list ]\n
 \n
 property_dict = {\'title\':title,\n
                  \'stop_date\' : stop_date,\n
@@ -99,7 +99,7 @@
 \n
 \n
 for item in object_list:\n
-  source_section = item.Item_getCurrentOwnerTitle(with_title=0)\n
+  source_section = item.Item_getCurrentOwnerValue()\n
   if source_section is not None:\n
     if source_section.getUid() is not None:\n
       pl_value =  pl_dict[str(source_section.getUid())]\n

Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_createDeliveryLine.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_createDeliveryLine.xml?rev=27100&r1=27099&r2=27100&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_createDeliveryLine.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_createDeliveryLine.xml [utf8] Fri May 22 15:16:46 2009
@@ -56,7 +56,7 @@
             <value> <string># Check data validity\n
 from Products.ERP5Type.Message import translateString\n
 source = context.Item_getCurrentSiteValue()\n
-source_section = context.Item_getCurrentOwnerTitle(with_title=0)\n
+source_section = context.Item_getCurrentOwnerValue()\n
 \n
 property_dict = {\'title\':title,                 \n
                  \'stop_date\' : stop_date,\n

Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerTitle.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerTitle.xml?rev=27100&r1=27099&r2=27100&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerTitle.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerTitle.xml [utf8] Fri May 22 15:16:46 2009
@@ -53,17 +53,10 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>from DateTime import DateTime\n
-\n
-date = DateTime()\n
-last_affectation = context.portal_simulation.getCurrentTrackingList(item=context.getRelativeUrl(), at_date=date)\n
-\n
-if len(last_affectation) == 0:\n
-  return None\n
-owner = context.portal_catalog.getObject(last_affectation[0].section_uid)\n
-if with_title:\n
-  return owner.getTitle()\n
-return owner\n
+            <value> <string>current_owner = context.Item_getCurrentOwnerValue()\n
+if current_owner is not None:\n
+  return current_owner.getTitle()\n
+return None\n
 </string> </value>
         </item>
         <item>
@@ -74,7 +67,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>with_title = 1</string> </value>
+            <value> <string></string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -94,22 +87,16 @@
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>0</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
-                            <string>with_title</string>
-                            <string>DateTime</string>
-                            <string>date</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>last_affectation</string>
-                            <string>len</string>
+                            <string>current_owner</string>
                             <string>None</string>
-                            <string>_getitem_</string>
-                            <string>owner</string>
                           </tuple>
                         </value>
                     </item>
@@ -121,9 +108,7 @@
         <item>
             <key> <string>func_defaults</string> </key>
             <value>
-              <tuple>
-                <int>1</int>
-              </tuple>
+              <none/>
             </value>
         </item>
         <item>

Added: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerValue.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerValue.xml?rev=27100&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerValue.xml (added)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentOwnerValue.xml [utf8] Fri May 22 15:16:46 2009
@@ -1,0 +1,139 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>from DateTime import DateTime\n
+\n
+date = DateTime()\n
+last_affectation_list = context.portal_simulation.getCurrentTrackingList(item=context.getRelativeUrl(), at_date=date)\n
+\n
+if len(last_affectation_list) == 0:\n
+  return None\n
+\n
+if last_affectation_list[0].section_uid is not None:\n
+  return context.portal_catalog.getObject(last_affectation_list[0].section_uid)\n
+\n
+return None\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>DateTime</string>
+                            <string>date</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>last_affectation_list</string>
+                            <string>len</string>
+                            <string>None</string>
+                            <string>_getitem_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Item_getCurrentOwnerValue</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteTitle.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteTitle.xml?rev=27100&r1=27099&r2=27100&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteTitle.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteTitle.xml [utf8] Fri May 22 15:16:46 2009
@@ -53,8 +53,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>if context.Item_getCurrentSiteValue() not in (\'\',None):\n
-  return context.Item_getCurrentSiteValue().getTitle()\n
+            <value> <string>current_site = context.Item_getCurrentSiteValue()\n
+if current_site is not None:\n
+  return current_site.getTitle()\n
 return None\n
 </string> </value>
         </item>
@@ -94,6 +95,7 @@
                           <tuple>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>current_site</string>
                             <string>None</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteValue.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteValue.xml?rev=27100&r1=27099&r2=27100&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteValue.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getCurrentSiteValue.xml [utf8] Fri May 22 15:16:46 2009
@@ -57,13 +57,14 @@
 \n
 date = DateTime()\n
 last_affectation_list = context.portal_simulation.getCurrentTrackingList(item=context.getRelativeUrl(), at_date=date)\n
-#context.log(\'last_affectation_list\',len(last_affectation_list))\n
+\n
 if len(last_affectation_list) == 0:\n
   return None\n
+\n
 if last_affectation_list[0].node_uid is not None:\n
   site = context.portal_catalog.getObject(last_affectation_list[0].node_uid)\n
-  #context.log(\'site\',site)\n
   return site\n
+\n
 return None\n
 </string> </value>
         </item>

Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceTitle.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceTitle.xml?rev=27100&r1=27099&r2=27100&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceTitle.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceTitle.xml [utf8] Fri May 22 15:16:46 2009
@@ -53,9 +53,10 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>if context.Item_getResourceValue() is not None:\n
-  return context.Item_getResourceValue().getTitle()\n
-return \'\'\n
+            <value> <string>resource = context.Item_getResourceValue()\n
+if resource is not None:\n
+  return resource.getTitle()\n
+return None\n
 </string> </value>
         </item>
         <item>
@@ -94,6 +95,7 @@
                           <tuple>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>resource</string>
                             <string>None</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceValue.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceValue.xml?rev=27100&r1=27099&r2=27100&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceValue.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_item/SkinTemplateItem/portal_skins/erp5_item/Item_getResourceValue.xml [utf8] Fri May 22 15:16:46 2009
@@ -58,15 +58,15 @@
 #kw[\'at_date\'] = DateTime()\n
 kw[\'item\'] = context.getRelativeUrl()\n
 \n
-last_affectation_list = context.portal_simulation.getTrackingList(**kw)\n
+last_affectation_list = context.portal_simulation.getCurrentTrackingList(**kw)\n
 \n
 if kw.get(\'src__\',0):\n
   return last_affectation_list\n
+\n
 if len(last_affectation_list):\n
   last_affectation = last_affectation_list[0]\n
   if last_affectation.resource_uid is not None:\n
     resource_value = context.portal_catalog.getObject(last_affectation.resource_uid)\n
-   \n
     return resource_value\n
 \n
 return None\n




More information about the Erp5-report mailing list