Commit fb894cf8 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Provides a shorter title in category popups;

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13047 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d3825409
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Example code:\n
\n
def getCompactTitle(category):\n
title_list = []\n
while category.getPortalType() == \'Category\':\n
if category.getCodification() or category.getShortTitle():\n
compact_title = category.getTranslatedShortTitle() or category.getReference() or category.getTranslatedTitle()\n
title_list.append(compact_title)\n
category = category.getParentValue()\n
if title_list:\n
title_list = title_list[:-1]\n
title_list.reverse()\n
return \'/\'.join(title_list)\n
\n
def compareTitle(a, b):\n
return cmp(a[1], b[1])\n
\n
def getCompactChildItemList(context):\n
result = context.getCategoryChildItemList(display_method=getCompactTitle)\n
result.sort(compareTitle)\n
return result\n
\n
from Products.ERP5Type.Cache import CachingMethod\n
cached_getCompactChildItemList = CachingMethod(getCompactChildItemList, id=\'getCompactChildItemList\')\n
return cached_getCompactChildItemList(context)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>getCompactTitle</string>
<string>compareTitle</string>
<string>getCompactChildItemList</string>
<string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string>
<string>cached_getCompactChildItemList</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Category_getCompactChildItemList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</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