[Zope] dtml-in sort question

Dieter Maurer dieter@handshake.de
Thu, 10 Aug 2000 22:10:35 +0200 (CEST)


Jean Jordaan writes:
 > I'd like to sort bunch of objects, and this doesn't seem to 
 > work: 
 > 
 >   <dtml-in "PARENTS[0].objectItems(['ccDocClassMetaType'])" sort=id>
 > 
 > Should it work? How does one sort the results returned by an 
 > expression such as the above?
I think so. Does it not?

I probably would use "objectValues" instead of "objectItems".
"objectIdems" gives you a sequence of "id,value" pairs,
"objectValues" gives you just the sequence of values.

If your objects should not have an "id", the sort above would
not work. In this case, you could try:

   <dtml-in "PARENTS[0].objectItems(['ccDocClassMetaType'])" sort=sequence-key>



Dieter