[Zope] dtml-in/sort equivalent in Product

Oleg Broytmann Oleg Broytmann <phd@phd.pp.ru>
Thu, 20 Jun 2002 19:24:02 +0400


On Thu, Jun 20, 2002 at 05:16:31PM +0200, Michal Bencur wrote:
> <dtml-in prefix="loop"
>          expr="objectValues('Something')"
>          sort="id/cmp/desc"
>          size="10">
> 
> Is there something in Zope to do this, or do I have to write
> sorting method and sort it myself ?

   Extended DTML Sort at your service! :) Something like this:

from DTML import sequence
return sequence.sort(objectValues('Something'),
   sort=(("id", "cmp", "desc"),))

Oleg.
-- 
     Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.