[Zope] Increment In PT?

tonylabarbara at aol.com tonylabarbara at aol.com
Mon Jul 30 13:18:38 EDT 2007


Can you give me an example of how to use the enumerate method in a repeat? I've googled this with no luck. Here's my tal:repeat clause:
????? <span tal:repeat="bitem_id bitem_ids;" tal:omit-tag="">
As fas as passing this to a python script, I'd rather not. That seems like too much trouble for something that IMHO should be easy, and if it's not, perhaps the gods of PT would like to do something about it.

TIA,

Tony


-----Original Message-----
From: Andrew Milton <akm at theinternet.com.au>
To: tonylabarbara at aol.com
Cc: lists at zopyx.com; zope at zope.org
Sent: Mon, 30 Jul 2007 12:30 pm
Subject: Re: [Zope] Increment In PT?




+-------[ tonylabarbara at aol.com ]----------------------
| 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?

1) Why not use the "enumerate" method in your repeat?
2) Why not pass the items to a python script that builds the structure you
   need and returns it?

-- 
Andrew Milton
akm at theinternet.com.au


________________________________________________________________________
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/bd269144/attachment.htm


More information about the Zope mailing list