[Zope] Dynamic Sum
Andy McKay
andy@agmweb.ca
Tue, 17 Sep 2002 09:03:11 -0700
dtml-in provides some variables that may be enough. If not move it to a
Python script, do the work there and do simple presentation from dtml. From
the online help:
Summary Variables
These variable summarize information about numeric item variables. To
use these variable you must loop over objects (like database query results)
that have numeric variables.
total-variable
The total of all occurrences of an item variable.
count-variable
The number of occurrences of an item variable.
etc...
--
Andy McKay
Agmweb Consulting
http://www.agmweb.ca
----- Original Message -----
From: "Michael Fox" <Michael@CenturySoftware.com.au>
To: <zope@zope.org>
Sent: Monday, September 16, 2002 6:04 PM
Subject: [Zope] Dynamic Sum
Hi *,
I have a dtml-in which lists both quantity and cost of items in my table.
I am generating the total for each item row like so -
<dtml-var expr="cost * qty" fmt="dollars-and-cents-with-commas">
What would be the practical approach to calculating the sum of all totals
for each item here?
Regards,
Michael Fox
Web Analyst/Programmer
Century Software
Ph: +612 9460 1422
Fax: +612 9460 3098
Email: michael@centurysoftware.com.au
This E-mail from Century Software Pty Ltd expresses the views of the sender
and not necessarily the views of the Company. The E-mail and any files
transmitted with it are confidential to the intended recipient at
the E-mail address to which it has been addressed. The E-mail may not be
disclosed or used by any other than the addressee, nor may it be copied in
any way. If you are not the intended recipient please contact the
sender as soon as possible and delete any copies of this message.
Please note that although this E-mail has been checked, we cannot accept any
responsibility for any transmitted viruses. It is therefore your
responsibility to virus scan attachments (if any).
_______________________________________________
Zope maillist - Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope-dev )