Commit 8cd0338e authored by Jean-Paul Smets's avatar Jean-Paul Smets

Use script instead of expressions.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18989 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ea1c2ee
...@@ -65,52 +65,7 @@ ...@@ -65,52 +65,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>ignore = (\'custom\',)\n <value> <string>result = context.GlossaryModule_getTermDictListFromPropertySheet(property_sheet_list)\n
all_field_list = []\n
def iterate(obj):\n
for i in obj.objectValues():\n
if i.getId() in ignore:\n
continue\n
if i.meta_type==\'ERP5 Form\':\n
all_field_list.extend(i.objectValues())\n
elif i.isPrincipiaFolderish:\n
iterate(i)\n
\n
iterate(context.portal_skins)\n
\n
properties = []\n
for i in property_sheet_list:\n
properties.extend(context.GlossaryModule_getPropertySheetAttributeList(i))\n
\n
dic = {}\n
for i in all_field_list:\n
id = i.getId()\n
title = i.get_value(\'title\') or \'\'\n
skin_id = i.aq_parent.aq_parent.getId()\n
prefix = \'erp5_\'\n
if skin_id.startswith(prefix):\n
skin_id = skin_id[len(prefix):]\n
if id.startswith(\'my_\'):\n
for p in properties:\n
if id==\'my_%s\' % p:\n
key = (p, skin_id, title)\n
dic[key] = i\n
if id.startswith(\'your_\'):\n
for p in properties:\n
if id==\'your_%s\' % p:\n
key = (p, skin_id, title)\n
dic[key] = i\n
\n
result = []\n
for (reference, business_field, title) in dic.keys():\n
language = \'en\'\n
field = dic[(reference, business_field, title)]\n
description = field.get_value(\'description\')\n
result.append({\'reference\':reference,\n
\'language\':language,\n
\'business_field\':business_field,\n
\'title\':title,\n
\'description\':description})\n
\n \n
if export_tsv:\n if export_tsv:\n
for i in result:\n for i in result:\n
...@@ -173,31 +128,13 @@ context.REQUEST.RESPONSE.redirect(context.absolute_url())\n ...@@ -173,31 +128,13 @@ context.REQUEST.RESPONSE.redirect(context.absolute_url())\n
<string>kw</string> <string>kw</string>
<string>_print_</string> <string>_print_</string>
<string>_print</string> <string>_print</string>
<string>ignore</string>
<string>all_field_list</string>
<string>iterate</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>properties</string> <string>result</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>i</string> <string>i</string>
<string>dic</string>
<string>id</string>
<string>title</string>
<string>skin_id</string>
<string>prefix</string>
<string>_getitem_</string>
<string>len</string>
<string>p</string>
<string>key</string>
<string>_write_</string>
<string>result</string>
<string>reference</string>
<string>business_field</string>
<string>language</string>
<string>field</string>
<string>description</string>
<string>map</string> <string>map</string>
<string>_getitem_</string>
<string>new_id</string> <string>new_id</string>
</tuple> </tuple>
</value> </value>
......
...@@ -135,7 +135,9 @@ return result\n ...@@ -135,7 +135,9 @@ return result\n
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
<value> <value>
<tuple> <tuple>
<string>Authenticated</string>
<string>Manager</string> <string>Manager</string>
<string>Member</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="ERP5Form" module="Products.ERP5Form.Form"/>
<string>Products.ERP5Form.Form</string> <tuple/>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -74,34 +71,31 @@ ...@@ -74,34 +71,31 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>bottom</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list/> <list/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>center</string> </key> <key> <string>center</string> </key>
<value> <value>
<list/> <list/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value>
<list/> <list/>
</value> </value>
</item> </item>
<item> <item>
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list/>
<string>my_property_sheet_list</string>
<string>my_export_tsv</string>
</list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list/> <list/>
</value> </value>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment