[Erp5-report] r18904 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jan 29 16:06:22 CET 2008
Author: alex
Date: Tue Jan 29 16:06:21 2008
New Revision: 18904
URL: http://svn.erp5.org?rev=18904&view=rev
Log:
Base_getFieldParameterDict:
* add suport for list fields
* rename id to field_id to prevent overloading
Base_viewFieldLibrary/my_multi_relation_field
* use Base_getFieldParameterDict to guess some field values (similar to my_relation_field)
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldParameterDict.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_multi_relation_field.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldParameterDict.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldParameterDict.xml?rev=18904&r1=18903&r2=18904&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldParameterDict.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getFieldParameterDict.xml Tue Jan 29 16:06:21 2008
@@ -69,19 +69,26 @@
Get default relation string field parameters\n
based on its id\n
"""\n
-id = context.getId()\n
-if not id.startswith(\'my_\'): return {} # this should not happen\n
+field_id = context.getId()\n
+if not field_id.startswith(\'my_\'): return {} # this should not happen\n
\n
-if id.endswith(\'_relative_url\'): idx = 2\n
-elif id.endswith(\'_title\'): idx = 1\n
+is_list = 0\n
+if field_id.endswith(\'_relative_url\'): idx = 2\n
+elif field_id.endswith(\'_title\'): idx = 1\n
+elif field_id.endswith(\'_title_list\'):\n
+ idx = 2\n
+ is_list = 1\n
else: idx = 0\n
\n
# can it be translated title, or something else?\n
\n
-pieces = id.split(\'_\')\n
+pieces = field_id.split(\'_\')\n
parameter_dict = dict()\n
parameter_dict[\'base_category\'] = \'_\'.join(pieces[1:-idx])\n
-parameter_dict[\'catalog_index\'] = \'_\'.join(pieces[-idx:])\n
+if is_list == 0:\n
+ parameter_dict[\'catalog_index\'] = \'_\'.join(pieces[-idx:])\n
+else:\n
+ parameter_dict[\'catalog_index\'] = \'_\'.join(pieces[-idx:-1]) \n
return parameter_dict\n
</string> </value>
</item>
@@ -93,6 +100,12 @@
</item>
<item>
<key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
<value>
<none/>
</value>
@@ -127,7 +140,8 @@
<tuple>
<string>_getattr_</string>
<string>context</string>
- <string>id</string>
+ <string>field_id</string>
+ <string>is_list</string>
<string>idx</string>
<string>pieces</string>
<string>dict</string>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_multi_relation_field.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_multi_relation_field.xml?rev=18904&r1=18903&r2=18904&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_multi_relation_field.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_multi_relation_field.xml Tue Jan 29 16:06:21 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.ERP5Form.MultiRelationField</string>
- <string>MultiRelationStringField</string>
- </tuple>
- <none/>
+ <global name="MultiRelationStringField" module="Products.ERP5Form.MultiRelationField"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -232,11 +229,15 @@
</item>
<item>
<key> <string>base_category</string> </key>
- <value> <string></string> </value>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+ </value>
</item>
<item>
<key> <string>catalog_index</string> </key>
- <value> <string></string> </value>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+ </value>
</item>
<item>
<key> <string>columns</string> </key>
@@ -293,7 +294,7 @@
<item>
<key> <string>height</string> </key>
<value>
- <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+ <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
@@ -371,7 +372,7 @@
<item>
<key> <string>width</string> </key>
<value>
- <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+ <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
@@ -395,11 +396,11 @@
</item>
<item>
<key> <string>base_category</string> </key>
- <value> <string>(To be defined in proxy field)</string> </value>
+ <value> <string>(tales)</string> </value>
</item>
<item>
<key> <string>catalog_index</string> </key>
- <value> <string>(To be defined in proxy field)</string> </value>
+ <value> <string>(tales)</string> </value>
</item>
<item>
<key> <string>columns</string> </key>
@@ -563,11 +564,40 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
- <tuple>
- <string>Products.Formulator.TALESField</string>
- <string>TALESMethod</string>
- </tuple>
- <none/>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string>python: field.Base_getFieldParameterDict()[\'base_category\']</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="3" aka="AAAAAAAAAAM=">
+ <pickle>
+ <tuple>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string>python: field.Base_getFieldParameterDict()[\'catalog_index\']</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="4" aka="AAAAAAAAAAQ=">
+ <pickle>
+ <tuple>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -579,14 +609,11 @@
</dictionary>
</pickle>
</record>
- <record id="3" aka="AAAAAAAAAAM=">
+ <record id="5" aka="AAAAAAAAAAU=">
<pickle>
<tuple>
- <tuple>
- <string>Products.Formulator.TALESField</string>
- <string>TALESMethod</string>
- </tuple>
- <none/>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
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=18904&r1=18903&r2=18904&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Tue Jan 29 16:06:21 2008
@@ -1,1 +1,1 @@
-694
+695
More information about the Erp5-report
mailing list