[ZPT] Batching Oddity

alex@quad.com.ar alex@quad.com.ar
Wed, 5 Sep 2001 22:02:02 -0300


there's something I dont get, why doing batching on a template system, it's
supposed to be just for presentation, my suggestion: write a python script
that does all the batching and stuff, then call the template from it.
wrapping templates from python script makes a much better separation of
logic/presentation imho... anyone agrees?


Alex
----- Original Message -----
From: <ksmith@99hats.com>
To: <zpt@zope.org>
Sent: Wednesday, September 05, 2001 7:15 PM
Subject: [ZPT] Batching Oddity


> I have ZPT 1.4.0 on Zope 2.3.2
>
> I'm using classes to create a UBB clone.
>
> I never had any problems displaying forums and topics until I added
batching to the forum_template. Whenever I use batching as described in the
DTMLtoZPT conversion wiki page, I run to intermittent DNS errors on IE or
Unexpected Network Read Error on Lynx. When jumping around to other ZPT
pages.
>
> It can take four or five attempts to load a ZPT page. Once loaded, the
page is easy to access after that.
>
>
> In the Z2.log, no activity shows until I can finally load the page.
However, when it does load the page I get a 304.
>
> Does anyone have any ideas where I should be looking for trouble?
>
>
> ZBoard (Folderish Zclass)
>   - index_html --> dtml-var board_template (ZPT)
> ZForum (Folderish Zclass)
>   - index_html --> dtml-var forum_template (ZPT)
> ZTopic (Folderish Zclass)
>   - index_html --> dtml-var topic_template (ZPT)
> ZReply (Folderish ZClass)
>
>
>
> forum_template
>
> < table border="0" cellpadding="4" cellspacing="1" width="100%"
tal:define="b_start python:path('request/b_start') or 0;
>                  results python:here.listTopics();
>                  Batch python:modules['ZTUtils'].Batch;
>                  batch python:Batch(results, 10, int(b_start),orphan=6)" >
>
>
> < tr bgcolor=ffffff><td colspan=7 >
>     < a href="nextbatch"
>        tal:define="p batch/previous"
>        tal:condition="p"
>        tal:attributes="href string:?b_start=${p/first}">
>        &lt;&lt; Previous < span tal:replace="p/length" >n</ span >
>     </a>
> &nbsp;&nbsp;&nbsp;
> < a href="nextbatch" tal:define="n batch/next"
>        tal:condition="n"
>        tal:attributes="href string:?b_start=${batch/end}" >
>        Next < span tal:replace="n/length" >n< /span > &gt;&gt;
>     < /a >
>
> < /td >< /tr >
>
>
>