[Zope] Re: conditional dtml looping

Maik Jablonski maik.jablonski at uni-bielefeld.de
Thu May 27 05:00:27 EDT 2004


J-Town Productions Ltd. wrote:

> Can I  use dtml-in to loop through objects with a certain value for a 
> given property.
> 
> Using dtml-in with an if statement such as <dtml-if "visible=='show'"> 
> does not seem to work since the sequence still includes the items
> 
> What would the syntax be for dtml-in if "visible=='show'">?

Untested, but something like this should work:

<dtml-in "[
  object
  for object in objectValues()
  if object.getProperty('visible')=='show'
]">
...
</dtml-in>

-mj




More information about the Zope mailing list