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>
 </table>

which is just a direct translation of the corresponding Python:

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

a.

-- 
 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]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to