[Zope] Re: how to accumulate data using ZPT
Tino Wildenhain
tino at wildenhain.de
Tue May 24 07:46:22 EDT 2005
Am Dienstag, den 24.05.2005, 04:09 -0700 schrieb prabuddha ray:
> sorry,
> i missed the xplanaition.
> i think this'll explain...
> <div tal:define= penalty
> python:context.getPenalty(group_code=gcode,item_code=icode);
> penaltylen python:test(len(penalty)==0)>
>
> so not:penaltylen ensures that unit_cost is present for this row.
>
> anyway i think this worked finally :
> <td>
> <span tal:condition="not:penaltylen">
> <span tal:define="unit_cost python:penalty[0].unit_cost;
> global sum python:sum+unit_cost" tal:content="unit_cost"/>
> </span>
>
> <td><b tal:content="sum"></b></td></tr>
Why dont you write this as plain python code?
Python Scripts are made for that.
More information about the Zope
mailing list