Commit 31fe407f authored by Fabien Devaux's avatar Fabien Devaux

Changes to use formatting script.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7352 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 932be8ce
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
<value> <string encoding="base64">bfINCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
......@@ -66,8 +66,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>def display(x):\n
return "%s - %s" % (x.getId(), x.getTitle())\n
<value> <string>display = context.Account_getFormattedTitle\n
\n
def sort(x,y):\n
return cmp(display(x), display(y))\n
......@@ -128,10 +127,10 @@ return gap_item_list[:-1]\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>display</string>
<string>sort</string>
<string>_getattr_</string>
<string>context</string>
<string>display</string>
<string>sort</string>
<string>gap_root</string>
<string>KeyError</string>
<string>getGapItemList</string>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
<value> <string encoding="base64">bfINCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
......@@ -84,11 +84,10 @@ else:\n
category = \'portal_categories/account_type\'\n
\n
display_dict = {}\n
display_funct = context.Account_getFormattedTitle\n
\n
def display(x):\n
if x not in display_dict:\n
gap_id = x.getGapId()\n
account_title = x.getTitle()\n
display_dict[x] = "%s - %s" % (gap_id, account_title)\n
display_dict[x] = display_funct(x)\n
return display_dict[x]\n
\n
def sort(x,y):\n
......@@ -157,6 +156,7 @@ return getItemList(category=category, portal_path=portal_path)\n
<string>_getitem_</string>
<string>category</string>
<string>display_dict</string>
<string>display_funct</string>
<string>display</string>
<string>sort</string>
<string>None</string>
......
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