[Erp5-report] r11522 - /erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 29 21:12:33 CET 2006


Author: bartek
Date: Wed Nov 29 21:12:31 2006
New Revision: 11522

URL: http://svn.erp5.org?rev=11522&view=rev
Log:
code reorganisation so that we can get values

Added:
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectValueList.xml
Modified:
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.xml

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.xml?rev=11522&r1=11521&r2=11522&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectTitleList.xml Wed Nov 29 21:12:31 2006
@@ -71,14 +71,10 @@
             <value> <string># get related object title list in a security-aware way (without throwing exception\n
 # if I don\'t have permissions to access the object)\n
 \n
-cat_value_list=context.getPropertyList(category)\n
+ob_list=context.Base_getRelatedObjectValueList(category)\n
+title_list=[o.getTitle() for o in ob_list]\n
 \n
-def getTitleIfAvailable(cat_value):\n
-  ob=context.restrictedTraverse(cat_value,None)\n
-  return ob is not None and ob.getTitle() or \'\'\n
-\n
-title_list=[getTitleIfAvailable(c) for c in cat_value_list]\n
-return [t for t in title_list if t!=\'\']\n
+return filter(lambda t:t!=\'\',title_list)\n
 </string> </value>
         </item>
         <item>
@@ -130,14 +126,13 @@
                             <string>category</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>cat_value_list</string>
-                            <string>getTitleIfAvailable</string>
+                            <string>ob_list</string>
                             <string>append</string>
                             <string>$append0</string>
                             <string>_getiter_</string>
-                            <string>c</string>
+                            <string>o</string>
                             <string>title_list</string>
-                            <string>t</string>
+                            <string>filter</string>
                           </tuple>
                         </value>
                     </item>

Added: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectValueList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectValueList.xml?rev=11522&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectValueList.xml (added)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_getRelatedObjectValueList.xml Wed Nov 29 21:12:31 2006
@@ -1,0 +1,171 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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># get related object value list in a security-aware way (without throwing exception\n
+# if I don\'t have permissions to access the object)\n
+\n
+cat_value_list=context.getPropertyList(category)\n
+if cat_value_list is None:return []\n
+\n
+def getValueIfAvailable(cat_value):\n
+  ob=context.restrictedTraverse(cat_value,None)\n
+  return ob \n
+\n
+ob_list=[getValueIfAvailable(c) for c in cat_value_list]\n
+return ob_list\n
+return [o for o in ob_list if o is not None]\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>category</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>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>category</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>cat_value_list</string>
+                            <string>None</string>
+                            <string>getValueIfAvailable</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>c</string>
+                            <string>ob_list</string>
+                            <string>o</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>Base_getRelatedObjectValueList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>




More information about the Erp5-report mailing list