[Zope] Choice of the sorting key of a dtml-in tag

Oliver Bleutgen Oliver Bleutgen <myzope@gmx.net>
Fri, 13 Jul 2001 20:32:50 +0200


> Hi again,

> I'd like to make a page with a list of my Zclass instances and to be able
> to
> sort them by different key. I tryed with this code :

> <dtml-if "REQUEST.has_key('skey')">
> <dtml-else>
> <dtml-call "REQUEST.set('skey', 'bobobase_modification_time reverse')">
> </dtml-if>
> <dtml-in "objectValues(['article'])" size=3 sort=skey start=query_start>

Take a look at
lib/python/OFS/dtml/main.dtml
This is the management form for a folders contents view and
it contains every trick you need here.
IIRC they use

<dtml-in "objectValues(['article'])" size=3 sort_expr="skey" start=query_start>

i.e. sort_expr instead of sort.

Unfortunately I can't find any documentation besides the src of DT_in.py
about it's functionality.

cheers,
oliver