<HTML><BODY>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
Hi all: </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
&nbsp;</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">I 
want to order a sequence using the Sequence sorting module from a Python 
script. </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">I 
have the following code: <BR>"<BR>seq = [['Bruzon', 'CUB'], ['Anand', 
'IND'], ['Kasparov', 'RUS']]<BR>def test(oneElem, twoElem):<BR>
&nbsp;&nbsp;&nbsp; if oneElem[0] == twoElem[0]:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0<BR>&nbsp;&nbsp;&nbsp; 
elif oneElem[0] &gt; twoElem[0]:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 1<BR>&nbsp;&nbsp;&nbsp; 
else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
sort_on =(('self', test, 'desc'))<BR>return sequence.sort(seq, sort_on)<BR>
"</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
and i get the error:<BR>"<BR>Error Type: SyntaxError<BR>Error Value: sort 
option must contains no more than 2 fields<BR>"<BR>and Traceback:<BR>"<BR>
Traceback (innermost last):<BR>Module ZPublisher.Publish, line 101, in 
publish<BR>Module ZPublisher.mapply, line 88, in mapply<BR>Module 
ZPublisher.Publish, line 39, in call_object<BR>Module 
Shared.DC.Scripts.Bindings, line 306, in __call__<BR>Module 
Shared.DC.Scripts.Bindings, line 343, in _bindAndExec<BR>Module 
Products.PythonScripts.PythonScript, line 323, in _exec<BR>Module None, line 
21, in orderBy<BR>- <BR>- Line 21<BR>Module 
DocumentTemplate.sequence.SortEx, line 66, in sort<BR>Module 
DocumentTemplate.sequence.SortEx, line 161, in make_sortfunctions<BR>
SyntaxError: sort option must contains no more than 2 fields<BR>"</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
&nbsp;</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
what i'm doing wrong? <BR></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
any suggestion?</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
&nbsp;</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
Thanks in advance.</DIV>
</BODY></HTML>