[ZPT] Two column ZPT output from SQL

Duane Raymond duane.raymond at gmail.com
Tue Oct 5 05:24:11 EDT 2004


Hi,

I'm trying to get the results of a ZSQL query and present it in
multiple columns via ZPT.

I found the following code which does it with a range and have been
trying to adapt it with no luck so far:
Original code:
<table tal:define="items python:range(9);width python:2" border=1>
<tr tal:repeat="j python:range(0, len(items), width)">
 <td tal:repeat="i python:items[j:j+width]" tal:content="i"></td>
</tr>
</table>

My Code:
<table tal:define="items python:container.sql_getMyList();width
python:2" border=1>
<tr tal:repeat="j python:range(0, len(items), width)">
 <td tal:repeat="i python:items[j]" tal:content="i"></td>
</tr>
</table>

Unfortunately it only returns one column with half the data in.  I
know there are issues with not calling the column name, with returning
objects vs ranges, etc. - but I can't figure it out to make it work.

Can anyone give some input?

Cheers,

Duane


More information about the ZPT mailing list