[Zope] dtml-in sort question

2000-08-10 Thread Jean Jordaan

Hi all

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?

-- 
jean

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] dtml-in sort question

2000-08-10 Thread Dieter Maurer

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

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )