[Zope] Sorting in python script

Janko Hauser jhauser@ifm.uni-kiel.de
Thu, 25 Oct 2001 00:12:24 +0200 (CEST)


folder.objectValues('lala') returns a list. Save this list and use the
sort method of lists. Note this sorts the list inplace.

myobjs = folder.objectValues('lala')
myobjs.sort()
for item in myobjs:
   ....

HTH,
__Janko

Gitte Wange writes:
 > Hello again :-)
 > 
 > I am really trying new stuff here so bear with me please ..
 > 
 > when you have a dtml-in tag you can set sort=attribute
 > 
 > But how do you do that in a python script?
 > You can't do:
 > for item in folder.objectValues('lala') sort='something':
 > 
 > So how do you do it then ?
 > 
 > TIA,
 > Gitte Wange
 > 
 > 
 >