thanks that was creative and justified. BUT it didnt work. the total is still 0.
here is what i did. <div tal:define="unit_cost python:penalty.unit_cost; global sum python:0" tal:condition="not:penaltylen" tal:content="unit_cost" > <span tal:define="global sum python:sum+unit_cost"></span> </div> <tr><td <b>Total <td ><b tal:replace="sum"></b></td></tr> please tip me where I'm going wrong On 5/20/05, Deepak <[EMAIL PROTECTED]> wrote: > > Hi Prabuddha, > > check this ... > > <span tal:define="global sum python:0"/> > <span tal:repeat="item python:here.somesql()"> > <span tal:condition="item/var" tal:define="global sum > python:sum+item.var"/> > </span> > <span tal:content="sum"/> > > thanks, > > Deepak > > prabuddha ray wrote: > > >sorry for delay, > > but the options you gave are ruled out. > >actually not all the rows in the column have the values. > >further the total i'm looking for will result in a very complex query > >that i dont want to do onsidering the no. of rows are high. > > > > I just need something like a var in my ZPT which can just sum up the > >values if they are present. > >value's prsence i'm checking using tal:condition but how to add the > >value repeatedly in the sum var. > > > >kindly help. -- Share the vision of difference with ME _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )