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

Jean Lagarde jean.lagarde@eer-rc.com
Fri, 13 Jul 2001 07:20:31 -0700


Hi Benoit,

My first answer post!

Although I haven't tried that yet, my understanding is that 'sort' only
accepts constants, i.e. it will interpret skey as the literal 'skey', not as
its value. You need to use the undocumented 'sort_expr' instead, i.e.

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

I'm not sure if you can include 'reverse' in skey; you probably have to
state
that separately in the dtml-in tag.

Hope that solves your problem,

Do a search on sort_expr on this list for more details.

Cheers,

Jean

On Friday 13 July 2001 15:03, you wrote:

> 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>
>
> But it doesn't work : instances are not sorted correctly...
>
> Any idea ?