[Zope] ZPT reverse ordering

Geir Bækholt Geir Bækholt <geirh@funcom.com>
Fri, 3 May 2002 11:50:38 +0200



on or about, Friday, May 03, 2002, we have reason to believe that Tom Nixon=
 wrote something along the lines of :
>> i think this will help getting it reversed
>>  tal:repeat=3D"subitems
>> python:sequence.sort(thelist,(('bobobase_modification_time','d
>> esc'),))">

TN> Thanks for your help. I get an error when I try this though:

TN> Error Type: TALESError
TN> Error Value: exceptions.AttributeError on 'None' object has no attribute
TN> 'getitem' in "", at line 160, column 3

sorry .. my fault , you need a comparisations function in there too.
still untested:
sort(thelist,(('bobobase_modification_time','cmp','desc'),))

TN> If I take out the 'desc' then it works fine. Any ideas=3F

TN> Hang on a minute, I just fixed it! I replaced bobobase_modification_time
TN> with bobobase_creation_time, and left out the 'desc'. It now shows the
TN> most recent first.

well . the "desc" setting could come in handy anyway.. :-)

:-)

--=20
Geir B=E6kholt                      web-developer
geirh@funcom.com             funcom oslo | webdev-team