[Zope] sort in python script dynamically?

Andreas Jung andreas at andreas-jung.com
Thu Jan 8 11:02:58 EST 2004


Python: somelist.sort(cmpmethod)
Zope: sequence.sort()

Both methods are well documented.

-aj

--On Donnerstag, 8. Januar 2004 16:56 Uhr +0100 Jaroslav Lukesh 
<lukesh at seznam.cz> wrote:

> Dear all,
>
> I have python script that does
>
> for i in self.objectItems('Folder')
>
>
> I want to sort by value of i[0] before "i" is taken to FOR. So it is
> possible to do something like
>
>
> for i in self.objectItems('Folder').sort(i[0])
>
> ???
>
>
> I want to sort by id value, which is in thos case value of i[0]
>
>
> Under Zope DTML it is very easy:
>
>      <dtml-in "objectItems('Folder')" sort=id>
>
> But under python?
>
> Many thanks,
>
> J. Lukesh
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )







More information about the Zope mailing list