On July 17, Toby Sargeant wrote:
> <table tal:repeat="row rows">
>   <tal:block tal:define="casevar row/rowtype">
>     <tr tal:condition="python:casevar='group'">...</tr>
>     <tr tal:condition="python:casevar='user'">...</tr>
>     <tr tal:condition="python:casevar='files'">...</tr>
>   </tal:block>
> </table>

Why bother with the tal:define?  Just:

 <table tal:repeat="row rows">
   <tr tal:condition="python:row.rowtype=='group'">...</tr>
   <tr tal:condition="python:row.rowtype=='user">...</tr>
   <tr tal:condition="python:row.rowtype=='files">...</tr>

which is just a direct translation of the corresponding Python:

  for row in rows:
      if row.rowtype=='group':
          # etc


 Adrian van den Dries                           [EMAIL PROTECTED]
 Development team                               www.dev.flow.com.au
 FLOW Communications Pty. Ltd.                  www.flow.com.au

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

Reply via email to