[Erp5-report] r23104 - in /erp5/trunk/bt5/erp5_project: PortalTypeTemplateItem/portal_types...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 22 12:23:20 CEST 2008


Author: jerome
Date: Fri Aug 22 12:23:11 2008
New Revision: 23104

URL: http://svn.erp5.org?rev=23104&view=rev
Log:
generate an int index and reference. Rule is a bit different from Base_initIntIndexAndReference because int_index are increased by a step of 10. This could be made generic though

Added:
    erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Requirement_init.xml
Modified:
    erp5/trunk/bt5/erp5_project/PortalTypeTemplateItem/portal_types/Requirement.xml
    erp5/trunk/bt5/erp5_project/bt/revision

Modified: erp5/trunk/bt5/erp5_project/PortalTypeTemplateItem/portal_types/Requirement.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/PortalTypeTemplateItem/portal_types/Requirement.xml?rev=23104&r1=23103&r2=23104&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_project/PortalTypeTemplateItem/portal_types/Requirement.xml (original)
+++ erp5/trunk/bt5/erp5_project/PortalTypeTemplateItem/portal_types/Requirement.xml Fri Aug 22 12:23:11 2008
@@ -112,7 +112,7 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string></string> </value>
+            <value> <string>Requirement_init</string> </value>
         </item>
         <item>
             <key> <string>permission</string> </key>

Added: erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Requirement_init.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Requirement_init.xml?rev=23104&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Requirement_init.xml (added)
+++ erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Requirement_init.xml Fri Aug 22 12:23:11 2008
@@ -1,0 +1,178 @@
+<?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>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>parent = context.getParentValue()\n
+portal_type = context.getPortalType()\n
+\n
+step = 10 # XXX configure this ?\n
+index = 0\n
+\n
+siblings = [x for x in parent.contentValues(checked_permission=\'View\',\n
+                   filter={"portal_type": portal_type}) if x.getIntIndex()]\n
+\n
+if len(siblings):\n
+  index = max([r.getIntIndex() for r in siblings])\n
+\n
+index = index + step\n
+\n
+if parent.getPortalType() == portal_type:\n
+  reference = "%s.%s" % (parent.getReference(), index)\n
+else:\n
+  reference = str(index)\n
+\n
+context.edit(\n
+  int_index=index,\n
+  reference=reference,\n
+)\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>_params</string> </key>
+            <value> <string>*args, **kw</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>args</string>
+                            <string>kw</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>parent</string>
+                            <string>portal_type</string>
+                            <string>step</string>
+                            <string>index</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>x</string>
+                            <string>siblings</string>
+                            <string>len</string>
+                            <string>max</string>
+                            <string>r</string>
+                            <string>reference</string>
+                            <string>str</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>Requirement_init</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_project/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/bt/revision?rev=23104&r1=23103&r2=23104&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_project/bt/revision (original)
+++ erp5/trunk/bt5/erp5_project/bt/revision Fri Aug 22 12:23:11 2008
@@ -1,1 +1,1 @@
-551
+552




More information about the Erp5-report mailing list