[Zope] How to I get column totals?

Mike Renfro renfro@tntech.edu
Sat, 21 Jul 2001 11:11:39 -0500


On Fri, Jul 20, 2001 at 07:15:29PM -0500, Mark Langkau wrote:

> Let's say I'm not using a SQL query and I want to count the number
> of objects of certain types in a folder, present the individual
> totals, then add them into a combined total of all objects. Or let's
> say I'm running several SQL queries, perhaps against different
> databases (Oracle, MySQL, etc.) and I'd like to total the results of
> those.

It's not Zope per se, but I'd do it in Python -- objectValues()
returns a list, use len() to get its length, etc.

Or, for a more generic case, which would probably be done far better
in PythonScript (and completely untested):

<dtml-call "REQUEST.set('a',1)">
<dtml-call "REQUEST.set('b',2)">
<dtml-call "REQUEST.set('c',a+b)">

-- 
Mike Renfro  / R&D Engineer, Center for Manufacturing Research,
931 372-3601 / Tennessee Technological University -- renfro@tntech.edu