[Zope] dtml-in and objectValues()

Jerome Alet alet@unice.fr
Wed, 2 May 2001 10:09:59 +0200 (MET DST)


On Wed, 2 May 2001, Kai Hofmann wrote:

> I am successfully using
> 
> <dtml-in "subdir.objectValues()">
> ....
> </dtml-in>
> 
> now I wanted to do something like
> 
> <dtml-in "subdir.objectValues('*_de')>
> 
> i.e. only select objects from the subfolder with a name ending in "_de"
> how can this be done - I can not find any hint within the Zope docs/howtos
> :((((

objectValues accepts a list of meta types to search for, but not a
pattern, e.g.:

	objectValues(['Folder', 'Image'])

is accepted.

what you have to do is something like:

<UNTESTED>
  <dtml-in "subdir.objectValues()">
    <dtml-if "_['sequence-item'].getId()[-3:] == '_de'">
      do_something
    </dtml-if>
  </dtml-in>
</UNTESTED>

hoping this helps

Jerome Alet