Commit afa7a444 authored by Aurel's avatar Aurel

sort the list

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18821 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47848978
...@@ -71,7 +71,16 @@ if resource in (None,\'None\'):\n ...@@ -71,7 +71,16 @@ if resource in (None,\'None\'):\n
resource = request.get(\'field_my_resource\',None)\n resource = request.get(\'field_my_resource\',None)\n
item_model = context.getPortalObject().restrictedTraverse(resource)\n item_model = context.getPortalObject().restrictedTraverse(resource)\n
\n \n
return item_model.getVariationRangeCategoryItemList(display_id=\'title\',display_base_category=0)\n variation_list = item_model.getVariationRangeCategoryItemList(display_id=\'title\',display_base_category=0)\n
\n
# The 50 one is the default one\n
def sort_variation_list(a, b):\n
if a[0] == \'50\':\n
return -1\n
return cmp(a[0], b[0])\n
\n
variation_list.sort(sort_variation_list)\n
return variation_list\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -127,6 +136,8 @@ return item_model.getVariationRangeCategoryItemList(display_id=\'title\',display ...@@ -127,6 +136,8 @@ return item_model.getVariationRangeCategoryItemList(display_id=\'title\',display
<string>None</string> <string>None</string>
<string>resource</string> <string>resource</string>
<string>item_model</string> <string>item_model</string>
<string>variation_list</string>
<string>sort_variation_list</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
359 360
\ No newline at end of file \ 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