[Zope] "dtml-in" question

Dieter Maurer dieter@handshake.de
Fri, 24 Jan 2003 23:19:04 +0100


Thierry Florac wrote at 2003-1-24 12:38 +0100:
 > 
 >   Hi,
 > 
 > A little question about the "dtml-in" tag.
 > 
 > What I'd like to do is to build a list according to a property value,
 > like we can do with for "for" Python instruction, something like :
 > 
 >   <dtml-in "object for object in objectValues() if object.visible">
You want to learn about Python's list comprehension:

  You can use:

    <dtml-in expr="[object for object in objectValues() if object.visible]">
      ....

  Precisely, what you want and very intuitive....


Dieter