Commit b9e6293e authored by Jérome Perrin's avatar Jérome Perrin

sort displayed sections

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32235 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 18cc48fb
......@@ -62,8 +62,13 @@ value_list = section_value.getGroupRelatedValueList(portal_type=portal_type,\n
value_list = [r for r in value_list\n
if r.getProperty(\'validation_state\') not in (\'invalidated\', \'deleted\')]\n
\n
def sorted(seq, key):\n
seq = seq[::]\n
seq.sort(key=key)\n
return seq\n
\n
# convert to ListField format\n
return [(\'\', \'\')] + [(obj.getTitle(), obj.getRelativeUrl()) for obj in value_list]\n
return [(\'\', \'\')] + sorted([(obj.getTitle(), obj.getRelativeUrl()) for obj in value_list], key=lambda x: x[0])\n
</string> </value>
</item>
<item>
......@@ -110,6 +115,7 @@ return [(\'\', \'\')] + [(obj.getTitle(), obj.getRelativeUrl()) for obj in value
<string>$append0</string>
<string>_getiter_</string>
<string>r</string>
<string>sorted</string>
<string>obj</string>
</tuple>
</value>
......
1459
\ No newline at end of file
1460
\ No newline at end of file
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