Commit 201fb97f authored by Jérome Perrin's avatar Jérome Perrin

use Base_translateString and add some comments


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5597 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 695d6c08
......@@ -67,25 +67,28 @@
<item>
<key> <string>_body</string> </key>
<value> <string>account = None\n
if account == \'\' : \n
if account == \'\' :\n
if (hasattr(context, \'getPortalType\') and context.getPortalType() == \'Account\') :\n
account = context\n
elif same_type(account, \'\') : \n
elif same_type(account, \'\') :\n
account = context.getPortalObject().restrictedTraverse(account)\n
\n
node_uid = None\n
if account is not None : \n
if account is not None :\n
node_uid = account.getUid()\n
\n
ptype_translated_dict = {}\n
def translatePortalType(ptype) : \n
if not ptype_translated_dict.has_key(ptype) : \n
ptype_translated_dict[ptype] = context.Base_TranslateString(ptype)\n
return ptype_translated_dict[ptype]\n
def translatePortalType(ptype) :\n
"""Translate portal_type without retrieving the object from ZODB."""\n
if not ptype_translated_dict.has_key(ptype) :\n
ptype_translated_dict[ptype] = context.Base_translateString(ptype)\n
return ptype_translated_dict[ptype]\n
\n
item_list = [("", "")]\n
for entity in context.Account_zDistinctSectionList(node_uid = node_uid): \n
item_list.append(("%s (%s)" % (entity[\'title\'], translatePortalType(entity[\'portal_type\'])), entity[\'relative_url\']))\n
for entity in context.Account_zDistinctSectionList(node_uid = node_uid):\n
item_list.append(("%s (%s)" % ( entity[\'title\'],\n
translatePortalType(entity[\'portal_type\'])),\n
entity[\'relative_url\']))\n
\n
return item_list\n
</string> </value>
......@@ -97,15 +100,15 @@ return item_list\n
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_skins/erp5_accounting/Account_getDestinationSectionItemList</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<key> <string>_dav_writelocks</string> </key>
<value>
<none/>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/erp5/portal_skins/erp5_accounting/Account_getDestinationSectionItemList</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>account = \'\'</string> </value>
......@@ -167,6 +170,10 @@ return item_list\n
<key> <string>id</string> </key>
<value> <string>Account_getDestinationSectionItemList</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>TODO: rename as Account_getMirrorSectionItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
......@@ -176,4 +183,25 @@ return item_list\n
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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