[Zope] Increment In PT?

tonylabarbara at aol.com tonylabarbara at aol.com
Mon Jul 30 12:27:09 EDT 2007


In order to interact with the paypal shopping cart system, they want me to increment hidden fields, such as:



<input type="hidden" tal:attributes="value item/name; name python:'item_name_' + `x`">
<input type="hidden" tal:attributes="value item/id; name python:'item_number_' + `x`">

where "x" is a number from 1 on up, where "1" represents the first product in the shopping cart, "2" represents the second product, etc. So...we have to do it their way. Perhaps this is really bad ZPT, but we have to do it their way. Can ZPT handle this, or not?
TIA,
Tony

-----Original Message-----
From: Andreas Jung <lists at zopyx.com>
To: tonylabarbara at aol.com; zope at zope.org
Sent: Mon, 30 Jul 2007 10:23 am
Subject: Re: [Zope] Increment In PT?



 
--On 30. Juli 2007 10:16:35 -0400 tonylabarbara at aol.com wrote: 
 
> Hi; 
> I´m trying to increment a variable in a page template. Here´s the 
> general idea in my code: 
> 
> 
> <div metal:define-macro="main" tal:define="x python:0"> 
 
Why do you need a counter in ZPT? This is absolutely one 
of the worst things you can go in ZPT. Describe your concrete use-case 
and we might think about a suitable and clean solution. But thinking 
about counters in ZPT is a waste of life-time. 
 
-aj 


________________________________________________________________________
AOL now offers free email to everyone.  Find out more about what's free from AOL at AOL.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070730/34283155/attachment.htm


More information about the Zope mailing list