"QUIN Frédéric" wrote:
> Hello,
> I want to do :
> <dtml-in "objectValues('DTML Document')" sort=order>
> ...
> </dtml-in>
> I have some DTML Documents which don't have the property "order", and I
> don't want to consider those documents in my loop. But if I put the
> "sort=order" option, Zope raises an error
> How can I do ???

Here's a convoluted hack (untested).  I wonder if anyone can come up
with a better way.

<dtml-let values="objectValues('DTML Document')" filtered="[]">
  <dtml-in values>
    <dtml-if order>
      <dtml-call "filtered.append(_['sequence-item'])">
  <dtml-in filtered sort=order>
    ... your code here ...

... but the version of Zope in the CVS repository already has a change
that makes it so the sorting code will consider fields that don't exist
to have the value "None".  This makes it so you can sort the natural


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

Reply via email to