[Zope] batching help

Nicolas Georgakopoulos nicolasg at vtrip.net
Thu Dec 15 07:53:25 EST 2005


Hello all , I'm trying to display on the same page a table with (3 
columns) with content from a list . I'm trying to batch the results so 
that every 3 elements anothe row is created.
Can anyone give me a clue how to do that ?

this is my code:


 <table tal:define="Rnumber 
python:context.cm1.content.specialfile.getList('link_list') ; batch 
python:modules['ZTUtils'].Batch(Rnumber,size=3,start=0)">
        <th colspan="3">Main Title</th>
                <tr><th>Title 1</th><th>Title 2</th><th>Title 3</th></tr>
                <tr>
                                <td tal:repeat="num batch">
                                <span tal:condition="python:num < 3" 
tal:replace="structure num"> content goes here.. </span>
                    </td>
                </tr>        
                              <!--  <tr>
                                    <td tal:repeat="num batch">
                                <span tal:replace="structure num"> 
Material goes here </span>
                    </td>
                </tr> -->                                                  
    </table>


More information about the Zope mailing list