We've been using DTML for a few years now, but we have come to a point where we will be re-writing much of our zope content so I thought it would be a good time to look into ZPT. I've been converting a couple of our DTML pages to ZPT as an exercize (or "spike solution") to determine if we should make the switch. Anyway, I've run into a question that I can't seem to find an answer to in the docs. If I have something like this: <dtml-in "stuffAboutPeople()"> <dtml-var lastName> <dtml-var age><br> <dtml-if sequence_last> Number of people: <dtml-var count-lastName><br> Total of ages: <dtml-var total-age><br> Std deviation of ages: <dtml-var standard-deviation-age><br> </dtml-if> </dtml-in> I understand how to get the repeating names and ages using ZPT, but what I can't figure out is how to get the total of the ages and the standard deviation of the ages. I guess the real question is: "How do I provide data that is available via the batch summary features in dtml-in, using ZPT?" Thanks! Steve
On Fri, May 21, 2004 at 11:03:59AM -0600, Steve Jibson wrote:
I understand how to get the repeating names and ages using ZPT, but what I can't figure out is how to get the total of the ages and the standard deviation of the ages.
I guess the real question is: "How do I provide data that is available via the batch summary features in dtml-in, using ZPT?"
the "summary variables" of <dtml-in> are not provided for ZPT. You'd have to roll your own, maybe using a Script. For batching in general, see: http://zope.org/Documentation/Books/ZopeBook/current/AdvZPT.stx section "Batching Large Sets of Information" For more details see the Batch class in the ZTUtils module in the API reference. http://zope.org/Documentation/Books/ZopeBook/current/AppendixB.stx -- Paul Winkler http://www.slinkp.com
participants (2)
-
Paul Winkler -
Steve Jibson