Commit 21b01753 authored by Jean-Paul Smets's avatar Jean-Paul Smets

2007-01-09 JPS - support of ordering types

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11954 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cb9a4462
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
\n \n
from Products.Formulator.Errors import ValidationError, FormValidationError\n from Products.Formulator.Errors import ValidationError, FormValidationError\n
\n \n
request=context.REQUEST\n request = context.REQUEST\n
\n field_sort_type = request.form.get(\'field_sort_type\', None)\n
\n \n
try:\n try:\n
# No validation for now\n # No validation for now\n
...@@ -84,8 +84,13 @@ try:\n ...@@ -84,8 +84,13 @@ try:\n
i = 0\n i = 0\n
for k in field_sort_on:\n for k in field_sort_on:\n
if k != \'None\':\n if k != \'None\':\n
if field_sort_type is None:\n
v = field_sort_order[i]\n v = field_sort_order[i]\n
sort_on += [(k,v)]\n sort_on += [(k,v)]\n
else:\n
v = field_sort_order[i]\n
t = field_sort_type[i]\n
sort_on += [(k, v, t)]\n
i += 1\n i += 1\n
context.portal_selections.setSelectionSortOrder(selection_name, sort_on)\n context.portal_selections.setSelectionSortOrder(selection_name, sort_on)\n
except FormValidationError, validation_errors:\n except FormValidationError, validation_errors:\n
...@@ -149,12 +154,15 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n ...@@ -149,12 +154,15 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>request</string> <string>request</string>
<string>None</string>
<string>field_sort_type</string>
<string>sort_on</string> <string>sort_on</string>
<string>i</string> <string>i</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>k</string> <string>k</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>v</string> <string>v</string>
<string>t</string>
<string>validation_errors</string> <string>validation_errors</string>
<string>form</string> <string>form</string>
<string>field_errors</string> <string>field_errors</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