[ZPT] the best way for repeation

Jamie Heilman jamie@audible.transient.net
Mon, 18 Nov 2002 04:32:16 -0800


I'd say use method 2, but you can shorten your code by doing:

<table tal:condition="request/discussion_id | nothing">
 <tr tal:repeat="discussion python:container.sql.discussions.select(request)">
 ...
 </tr>
</table>
<table tal:condition="request/post_id | nothing">
 <tr tal:repeat="discussion python:container.sql.posts.select(request)">
 ...
 </tr>
</table>

You don't need all that extra defining & nesting.

-- 
Jamie Heilman                   http://audible.transient.net/~jamie/
"You came all this way, without saying squat, and now you're trying
 to tell me a '56 Chevy can beat a '47 Buick in a dead quarter mile?
 I liked you better when you weren't saying squat kid."	-Buddy