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