[Zope] tal:repeat

Dieter Maurer dieter@handshake.de
Tue, 30 Apr 2002 21:53:25 +0200


Casey Duncan writes:
 > <table>
 >   <tr tal:define="subfolders python:container.objectValues('Folder')">
 >     <span tal:repeat="folder subfolders" tal:omit-tag="">
 >       <td tal:attributes="bgcolor python:('yellow','red')[here is folder]"
 >            tal:content="folder/title>
 >         Title
 >       </td>
 >     </span>
 >   </tr>
 > </table>
 > 
 > It relies on the fact the "here is folder" always returns either a 1 or a 0
Be very careful when comparing acquisition wrapped objects.

They may compare unequal while you think they were the same object.
This will happen because almost any access in Zope creates a new
acquisition wrapper around the object.


Dieter