Re: [Zope] Increment In PT?

2007-07-30 Thread tonylabarbara

Well, there I go making mountains out of molehills again. This worked just fine:


    


Thanks for all,
Tony


-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; zope@zope.org
Sent: Mon, 30 Jul 2007 2:30 pm
Subject: Re: [Zope] Increment In PT?




It's complaining that:

Error Type: TypeError
Error Value: string indices must be integers


I tried back ticks and that still gave the same error.
TIA,
Tony



    
     





-Original Message-
From: José Henrique <[EMAIL PROTECTED]>
To: zope@zope.org
Sent: Mon, 30 Jul 2007 2:07 pm
Subject: Re: [Zope] Increment In PT?


Try this way:


    
     


Zenrique.


2007/7/30, Peter Bengtsson <[EMAIL PROTECTED]>: 
You should now have all the parts.
Instead of iterating over python:range(1000) do it on bitem_ids instead.

You don't have to use a  tag. You can use
 
if you want.
You increment it by calling tal:iter/next whichever way you do it.

[EMAIL PROTECTED] wrote:
> I would think this should be pretty easy in the PT itself, given what 
> you've shared so far. But I'm still not quite there. Here's what I've got:
>
>   
>
> 
>
> Now, I don't really want that  tag there, because it's printing a 
> number to screen that I don't want there. However, it only prints the
> number "1" twice, once for each product, when it should print 1 then 2,
> I would think. (I presume I should just take the tal:replace out and 
> leave the definition, but it's still not incrementing!) Later in the
> script I have this:
>
>  
> 
>
> and other similar lines. What I'm trying to effectuate is that the "x" 
> gets replaced with an incremented number. Can you help just a little more?
> TIA,
> Tony
>
> -Original Message-----
> From: Peter Bengtsson < [EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Cc: zope@zope.org
> Sent: Mon, 30 Jul 2007 1:32 pm
> Subject: Re: [Zope] Increment In PT? 
>
> You can use the ZTUtils Iterator()
>
> 
>    
>   
>   
> 
>
> Which might give you some freedom such as iter/Roman or iter/odd
> The above is practically the same as:
>
>    
>
> Generally, if you can, use a Python Script or something. The Iterator
> is/was used in Plone templates to increment the tab index.
>
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote:
>  > Hi;
>  > I´m trying to increment a variable in a page template. Here´s the >
> general idea in my code: 
>  > > 
>  > > 
>  > 
>  > 
>  > > > Now, all of that works...once. That is, it increments from 0 to
> 1, but > not from 1 to 2! Each time I pass through the td element, I
> need it to > increment. I tried putting the tal definition in the td,
> but then it > didn´t even increment once! What do?
>  > TIA,
>  > Tony
>  >  
>  > AOL now offers free email to everyone. Find out more about what's
> free > from AOL at *AOL.com*
> <http://www.aol.com?ncid=AOLAOF0002000437 
> <http://www.aol.com/?ncid=AOLAOF0002000437>>.
>  > > >
>  
>  > > ___
>  > Zope maillist - Zope@zope.org <mailto: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 )
>
> -- Peter Bengtsson,
> work www.fry-it.com <http://www.fry-it.com/>
> home www.peterbe.com < http://www.peterbe.com/>
> hobby www.issuetrackerproduct.com <http://www.issuetrackerproduct.com/>
>  
> AOL now offers free email to everyone. Find out more about what's free
> from AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF0002000437 >.

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com 
___
Zope [EMAIL PROTECTED]
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 )






___
ope maillist  -  Zope@zope.org
ttp://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 )


AOL now offe

Re: [Zope] Increment In PT?

2007-07-30 Thread tonylabarbara

This is the code that I have:
  
    



This is the code that I would like to write:
  
    


How can I do that?
TIA,
Tony

-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; zope@zope.org
Sent: Mon, 30 Jul 2007 2:30 pm
Subject: Re: [Zope] Increment In PT?




It's complaining that:

Error Type: TypeError
Error Value: string indices must be integers


I tried back ticks and that still gave the same error.
TIA,
Tony



    
     





-Original Message-
From: José Henrique <[EMAIL PROTECTED]>
To: zope@zope.org
Sent: Mon, 30 Jul 2007 2:07 pm
Subject: Re: [Zope] Increment In PT?


Try this way:


    
     


Zenrique.


2007/7/30, Peter Bengtsson <[EMAIL PROTECTED]>: 
You should now have all the parts.
Instead of iterating over python:range(1000) do it on bitem_ids instead.

You don't have to use a  tag. You can use
 
if you want.
You increment it by calling tal:iter/next whichever way you do it.

[EMAIL PROTECTED] wrote:
> I would think this should be pretty easy in the PT itself, given what 
> you've shared so far. But I'm still not quite there. Here's what I've got:
>
>   
>
> 
>
> Now, I don't really want that  tag there, because it's printing a 
> number to screen that I don't want there. However, it only prints the
> number "1" twice, once for each product, when it should print 1 then 2,
> I would think. (I presume I should just take the tal:replace out and 
> leave the definition, but it's still not incrementing!) Later in the
> script I have this:
>
>  
> 
>
> and other similar lines. What I'm trying to effectuate is that the "x" 
> gets replaced with an incremented number. Can you help just a little more?
> TIA,
> Tony
>
> -Original Message-----
> From: Peter Bengtsson < [EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Cc: zope@zope.org
> Sent: Mon, 30 Jul 2007 1:32 pm
> Subject: Re: [Zope] Increment In PT? 
>
> You can use the ZTUtils Iterator()
>
> 
>    
>   
>   
> 
>
> Which might give you some freedom such as iter/Roman or iter/odd
> The above is practically the same as:
>
>    
>
> Generally, if you can, use a Python Script or something. The Iterator
> is/was used in Plone templates to increment the tab index.
>
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote:
>  > Hi;
>  > I´m trying to increment a variable in a page template. Here´s the >
> general idea in my code: 
>  > > 
>  > > 
>  > 
>  > 
>  > > > Now, all of that works...once. That is, it increments from 0 to
> 1, but > not from 1 to 2! Each time I pass through the td element, I
> need it to > increment. I tried putting the tal definition in the td,
> but then it > didn´t even increment once! What do?
>  > TIA,
>  > Tony
>  >  
>  > AOL now offers free email to everyone. Find out more about what's
> free > from AOL at *AOL.com*
> <http://www.aol.com?ncid=AOLAOF0002000437 
> <http://www.aol.com/?ncid=AOLAOF0002000437>>.
>  > > >
>  
>  > > ___
>  > Zope maillist - Zope@zope.org <mailto: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 )
>
> -- Peter Bengtsson,
> work www.fry-it.com <http://www.fry-it.com/>
> home www.peterbe.com < http://www.peterbe.com/>
> hobby www.issuetrackerproduct.com <http://www.issuetrackerproduct.com/>
>  
> AOL now offers free email to everyone. Find out more about what's free
> from AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF0002000437 >.

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com 
___
Zope [EMAIL PROTECTED]
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 )






___
ope maillist  -  Zope@zope.org
ttp://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/

Re: [Zope] Increment In PT?

2007-07-30 Thread José Henrique
I understood that 'bitems' was a sequence of dictionaries. Ex: ({'name':
'xyz', 'id': 1'},{'name': 'pex', 'id': 2},{'name': 'wei', 'id': 3}...).
If it's something different, you have to change the code to handle your
object properly.

Zenrique.

2007/7/30, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> It's complaining that:
> *Error Type: TypeError*
> *Error Value: string indices must be integers*
>  I tried back ticks and that still gave the same error.
> TIA,
> Tony
>
> 
> 
> 
> 
>
>
>
>
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread tonylabarbara

It's complaining that:

Error Type: TypeError
Error Value: string indices must be integers


I tried back ticks and that still gave the same error.
TIA,
Tony



    
     





-Original Message-
From: José Henrique <[EMAIL PROTECTED]>
To: zope@zope.org
Sent: Mon, 30 Jul 2007 2:07 pm
Subject: Re: [Zope] Increment In PT?


Try this way:


    
     


Zenrique.


2007/7/30, Peter Bengtsson <[EMAIL PROTECTED]>:
You should now have all the parts.
Instead of iterating over python:range(1000) do it on bitem_ids instead.

You don't have to use a  tag. You can use
 
if you want.
You increment it by calling tal:iter/next whichever way you do it.

[EMAIL PROTECTED] wrote:
> I would think this should be pretty easy in the PT itself, given what 
> you've shared so far. But I'm still not quite there. Here's what I've got:
>
>   
>
> 
>
> Now, I don't really want that  tag there, because it's printing a 
> number to screen that I don't want there. However, it only prints the
> number "1" twice, once for each product, when it should print 1 then 2,
> I would think. (I presume I should just take the tal:replace out and 
> leave the definition, but it's still not incrementing!) Later in the
> script I have this:
>
>  
> 
>
> and other similar lines. What I'm trying to effectuate is that the "x" 
> gets replaced with an incremented number. Can you help just a little more?
> TIA,
> Tony
>
> -Original Message-----
> From: Peter Bengtsson < [EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Cc: zope@zope.org
> Sent: Mon, 30 Jul 2007 1:32 pm
> Subject: Re: [Zope] Increment In PT? 
>
> You can use the ZTUtils Iterator()
>
> 
>    
>   
>   
> 
>
> Which might give you some freedom such as iter/Roman or iter/odd
> The above is practically the same as:
>
>    
>
> Generally, if you can, use a Python Script or something. The Iterator
> is/was used in Plone templates to increment the tab index.
>
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote:
>  > Hi;
>  > I´m trying to increment a variable in a page template. Here´s the >
> general idea in my code: 
>  > > 
>  > > 
>  > 
>  > 
>  > > > Now, all of that works...once. That is, it increments from 0 to
> 1, but > not from 1 to 2! Each time I pass through the td element, I
> need it to > increment. I tried putting the tal definition in the td,
> but then it > didn´t even increment once! What do?
>  > TIA,
>  > Tony
>  >  
>  > AOL now offers free email to everyone. Find out more about what's
> free > from AOL at *AOL.com*
> <http://www.aol.com?ncid=AOLAOF0002000437 
> <http://www.aol.com/?ncid=AOLAOF0002000437>>.
>  > > >
>  
>  > > ___
>  > Zope maillist - Zope@zope.org <mailto: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 )
>
> -- Peter Bengtsson,
> work www.fry-it.com <http://www.fry-it.com/>
> home www.peterbe.com < http://www.peterbe.com/>
> hobby www.issuetrackerproduct.com <http://www.issuetrackerproduct.com/>
>  
> AOL now offers free email to everyone. Find out more about what's free
> from AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF0002000437 >.

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com 
___
Zope [EMAIL PROTECTED]
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 )






___
ope maillist  -  Zope@zope.org
ttp://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 )



AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread tonylabarbara
Okay, I've got this line:
    
and then use this kind of line several times further down and within the div:
    
What this yields is lines like this:
    
but it never increments! And I have 3 items! How do I get it to increment?
TIA,
Tony


-Original Message-
From: Peter Bengtsson <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Mon, 30 Jul 2007 1:52 pm
Subject: Re: [Zope] Increment In PT?


You should now have all the parts. 
Instead of iterating over python:range(1000) do it on bitem_ids instead. 
 
You don't have to use a  tag. You can use 
 
if you want. 
You increment it by calling tal:iter/next whichever way you do it. 
 
[EMAIL PROTECTED] wrote: 
> I would think this should be pretty easy in the PT itself, given what > 
> you've shared so far. But I'm still not quite there. Here's what I've got: 
> >  
>  
>  
> > Now, I don't really want that  tag there, because it's printing a > 
> > number to screen that I don't want there. However, it only prints the > 
> > number "1" twice, once for each product, when it should print 1 then 2, > I 
> > would think. (I presume I should just take the tal:replace out and > leave 
> > the definition, but it's still not incrementing!) Later in the > script I 
> > have this: 
> >  
>  
> > and other similar lines. What I'm trying to effectuate is that the "x" > 
> > gets replaced with an incremented number. Can you help just a little more? 
> TIA, 
> Tony 
> > -----Original Message- 
> From: Peter Bengtsson <[EMAIL PROTECTED]> 
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Sent: Mon, 30 Jul 2007 1:32 pm 
> Subject: Re: [Zope] Increment In PT? 
> > You can use the ZTUtils Iterator() > >  >  >  > tal:replace="iter/number" /> >  > tal:replace="iter/number" /> >  > > Which might give you some freedom 
> > such as iter/Roman or iter/odd > The above is practically the same as: > > 
> >  > > Generally, if you 
> > can, use a Python Script or something. The Iterator > is/was used in Plone 
> > templates to increment the tab index. > > [EMAIL PROTECTED] <mailto:[EMAIL 
> > PROTECTED]> wrote: > > Hi; > > I´m trying to increment a variable in a page 
> > template. Here´s the > > general idea in my code: > > >  > metal:define-macro="main" tal:define="x python:0"> > > >  > tal:define="x python:x + 1"> > >  > >  > tal:attributes="value item/name; name > > python:'item_name_' + `x`"> > > > 
> > > Now, all of that works...once. That is, it increments from 0 to > 1, but 
> > > not from 1 to 2! Each time I pass through the td element, I > need it to 
> > > increment. I tried putting the tal definition in the td, > but then it > 
> > didn´t even increment once! What do? > > TIA, > > Tony > > 
> >  > 
> > > AOL now offers free email to everyone. Find out more about what's > free 
> > > from AOL at *AOL.com* > <http://www.aol.com?ncid=AOLAOF0002000437 > 
> > <http://www.aol.com/?ncid=AOLAOF0002000437>>. > > > > > 
> >  > 
> > > > ___ > > Zope maillist - 
> > Zope@zope.org <mailto: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 ) > > -- Peter Bengtsson, > 
> > work www.fry-it.com <http://www.fry-it.com/> > home www.peterbe.com 
> > <http://www.peterbe.com/> > hobby www.issuetrackerproduct.com 
> > <http://www.issuetrackerproduct.com/> > 
> >  
> AOL now offers free email to everyone. Find out more about what's free > from 
> AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF0002000437>. 
 
-- Peter Bengtsson, 
work www.fry-it.com 
home www.peterbe.com 
hobby www.issuetrackerproduct.com 



AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread José Henrique
Try this way:






Zenrique.

2007/7/30, Peter Bengtsson <[EMAIL PROTECTED]>:
>
> You should now have all the parts.
> Instead of iterating over python:range(1000) do it on bitem_ids instead.
>
> You don't have to use a  tag. You can use
> 
> if you want.
> You increment it by calling tal:iter/next whichever way you do it.
>
> [EMAIL PROTECTED] wrote:
> > I would think this should be pretty easy in the PT itself, given what
> > you've shared so far. But I'm still not quite there. Here's what I've
> got:
> >
> >   
> >
> > 
> >
> > Now, I don't really want that  tag there, because it's printing a
> > number to screen that I don't want there. However, it only prints the
> > number "1" twice, once for each product, when it should print 1 then 2,
> > I would think. (I presume I should just take the tal:replace out and
> > leave the definition, but it's still not incrementing!) Later in the
> > script I have this:
> >
> > 
> > 
> >
> > and other similar lines. What I'm trying to effectuate is that the "x"
> > gets replaced with an incremented number. Can you help just a little
> more?
> > TIA,
> > Tony
> >
> > -Original Message-
> > From: Peter Bengtsson <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Cc: zope@zope.org
> > Sent: Mon, 30 Jul 2007 1:32 pm
> > Subject: Re: [Zope] Increment In PT?
> >
> > You can use the ZTUtils Iterator()
> >
> > 
> >   
> >   
> >   
> > 
> >
> > Which might give you some freedom such as iter/Roman or iter/odd
> > The above is practically the same as:
> >
> >   
> >
> > Generally, if you can, use a Python Script or something. The Iterator
> > is/was used in Plone templates to increment the tab index.
> >
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote:
> >  > Hi;
> >  > I´m trying to increment a variable in a page template. Here´s the >
> > general idea in my code:
> >  > > 
> >  > > 
> >  > 
> >  > 
> >  > > > Now, all of that works...once. That is, it increments from 0 to
> > 1, but > not from 1 to 2! Each time I pass through the td element, I
> > need it to > increment. I tried putting the tal definition in the td,
> > but then it > didn´t even increment once! What do?
> >  > TIA,
> >  > Tony
> >  >
> 
> >  > AOL now offers free email to everyone. Find out more about what's
> > free > from AOL at *AOL.com*
> > <http://www.aol.com?ncid=AOLAOF0002000437
> > <http://www.aol.com/?ncid=AOLAOF0002000437>>.
> >  > > >
> > 
> >  > > ___
> >  > Zope maillist - Zope@zope.org <mailto: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 )
> >
> > -- Peter Bengtsson,
> > work www.fry-it.com <http://www.fry-it.com/>
> > home www.peterbe.com <http://www.peterbe.com/>
> > hobby www.issuetrackerproduct.com <http://www.issuetrackerproduct.com/>
> > 
> > AOL now offers free email to everyone. Find out more about what's free
> > from AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF0002000437>.
>
> --
> Peter Bengtsson,
> work www.fry-it.com
> home www.peterbe.com
> hobby www.issuetrackerproduct.com
> ___
> 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 )
>
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread Peter Bengtsson

You should now have all the parts.
Instead of iterating over python:range(1000) do it on bitem_ids instead.

You don't have to use a  tag. You can use

if you want.
You increment it by calling tal:iter/next whichever way you do it.

[EMAIL PROTECTED] wrote:
I would think this should be pretty easy in the PT itself, given what 
you've shared so far. But I'm still not quite there. Here's what I've got:
 
  
   



Now, I don't really want that  tag there, because it's printing a 
number to screen that I don't want there. However, it only prints the 
number "1" twice, once for each product, when it should print 1 then 2, 
I would think. (I presume I should just take the tal:replace out and 
leave the definition, but it's still not incrementing!) Later in the 
script I have this:






and other similar lines. What I'm trying to effectuate is that the "x" 
gets replaced with an incremented number. Can you help just a little more?

TIA,
Tony

-Original Message-
From: Peter Bengtsson <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Mon, 30 Jul 2007 1:32 pm
Subject: Re: [Zope] Increment In PT?

You can use the ZTUtils Iterator() 
 
 
   
   
   
 
 
Which might give you some freedom such as iter/Roman or iter/odd 
The above is practically the same as: 
 
   
 
Generally, if you can, use a Python Script or something. The Iterator 
is/was used in Plone templates to increment the tab index. 
 
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote: 
 > Hi; 
 > I´m trying to increment a variable in a page template. Here´s the > 
general idea in my code: 
 > >  
 > >  
 >  
 >  
 > > > Now, all of that works...once. That is, it increments from 0 to 
1, but > not from 1 to 2! Each time I pass through the td element, I 
need it to > increment. I tried putting the tal definition in the td, 
but then it > didn´t even increment once! What do? 
 > TIA, 
 > Tony 
 >  
 > AOL now offers free email to everyone. Find out more about what's 
free > from AOL at *AOL.com* 
<http://www.aol.com?ncid=AOLAOF0002000437 
<http://www.aol.com/?ncid=AOLAOF0002000437>>. 
 > > > 
 
 > > ___ 
 > Zope maillist - Zope@zope.org <mailto: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 ) 
 
-- Peter Bengtsson, 
work www.fry-it.com <http://www.fry-it.com/> 
home www.peterbe.com <http://www.peterbe.com/> 
hobby www.issuetrackerproduct.com <http://www.issuetrackerproduct.com/> 

AOL now offers free email to everyone. Find out more about what's free 
from AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF0002000437>.


--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread José Henrique
Use ZPT repeat variables (
http://www.plope.com/Books/2_7Edition/AdvZPT.stx#2-3).


2007/7/30, Peter Bengtsson <[EMAIL PROTECTED]>:
>
> You can use the ZTUtils Iterator()
>
>
> 
>
>
>
> 
>
> Which might give you some freedom such as iter/Roman or iter/odd
> The above is practically the same as:
>
>
>
> Generally, if you can, use a Python Script or something. The Iterator
> is/was used in Plone templates to increment the tab index.
>
> [EMAIL PROTECTED] wrote:
> > Hi;
> > I´m trying to increment a variable in a page template. Here´s the
> > general idea in my code:
> >
> > 
> >
> > 
> > 
> > 
> >
> >
> > Now, all of that works...once. That is, it increments from 0 to 1, but
> > not from 1 to 2! Each time I pass through the td element, I need it to
> > increment. I tried putting the tal definition in the td, but then it
> > didn´t even increment once! What do?
> > TIA,
> > Tony
> > 
> > AOL now offers free email to everyone. Find out more about what's free
> > from AOL at *AOL.com* .
> >
> >
> > 
> >
> > ___
> > 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 )
>
> --
> Peter Bengtsson,
> work www.fry-it.com
> home www.peterbe.com
> hobby www.issuetrackerproduct.com
> ___
> 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 )
>
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread tonylabarbara

I would think this should be pretty easy in the PT itself, given what you've 
shared so far. But I'm still not quite there. Here's what I've got:


  
    
    


Now, I don't really want that  tag there, because it's printing a number 
to screen that I don't want there. However, it only prints the number "1" 
twice, once for each product, when it should print 1 then 2, I would think. (I 
presume I should just take the tal:replace out and leave the definition, but 
it's still not incrementing!) Later in the script I have this:

    
    

and other similar lines. What I'm trying to effectuate is that the "x" gets 
replaced with an incremented number. Can you help just a little more?
TIA,
Tony

-Original Message-
From: Peter Bengtsson <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: zope@zope.org
Sent: Mon, 30 Jul 2007 1:32 pm
Subject: Re: [Zope] Increment In PT?



You can use the ZTUtils Iterator() 
 
 
   
   
   
 
 
Which might give you some freedom such as iter/Roman or iter/odd 
The above is practically the same as: 
 
   
 
Generally, if you can, use a Python Script or something. The Iterator is/was 
used in Plone templates to increment the tab index. 
 
[EMAIL PROTECTED] wrote: 
> Hi; 
> I´m trying to increment a variable in a page template. Here´s the > general 
> idea in my code: 
> >  
> >  
>  
>  
> > > Now, all of that works...once. That is, it increments from 0 to 1, but > 
> > > not from 1 to 2! Each time I pass through the td element, I need it to > 
> > > increment. I tried putting the tal definition in the td, but then it > 
> > > didn´t even increment once! What do? 
> TIA, 
> Tony 
>  
> AOL now offers free email to everyone. Find out more about what's free > from 
> AOL at *AOL.com* <http://www.aol.com?ncid=AOLAOF0002000437>. 
> > >  
> > ___ 
> Zope maillist - [EMAIL PROTECTED]
> 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 ) 
 
-- Peter Bengtsson, 
work www.fry-it.com 
home www.peterbe.com 
hobby www.issuetrackerproduct.com 



AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread Peter Bengtsson

You can use the ZTUtils Iterator()



  
  
  


Which might give you some freedom such as iter/Roman or iter/odd
The above is practically the same as:

  

Generally, if you can, use a Python Script or something. The Iterator 
is/was used in Plone templates to increment the tab index.


[EMAIL PROTECTED] wrote:

Hi;
I´m trying to increment a variable in a page template. Here´s the 
general idea in my code:



 







Now, all of that works...once. That is, it increments from 0 to 1, but 
not from 1 to 2! Each time I pass through the td element, I need it to 
increment. I tried putting the tal definition in the td, but then it 
didn´t even increment once! What do?

TIA,
Tony

AOL now offers free email to everyone. Find out more about what's free 
from AOL at *AOL.com* .





___
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 )


--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread tonylabarbara

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:
? 
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 <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; zope@zope.org
Sent: Mon, 30 Jul 2007 12:30 pm
Subject: Re: [Zope] Increment In PT?




+---[ [EMAIL PROTECTED] ]--
| In order to interact with the paypal shopping cart system, they want me to
| increment hidden fields, such as:
|  
| 
| 
| 
| 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
[EMAIL PROTECTED]



AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread Andrew Milton
+---[ [EMAIL PROTECTED] ]--
| In order to interact with the paypal shopping cart system, they want me to
| increment hidden fields, such as:
|  
| 
| 
| 
| 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
[EMAIL PROTECTED]
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread tonylabarbara

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






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 <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]; zope@zope.org
Sent: Mon, 30 Jul 2007 10:23 am
Subject: Re: [Zope] Increment In PT?



 
--On 30. Juli 2007 10:16:35 -0400 [EMAIL PROTECTED] wrote: 
 
> Hi; 
> I´m trying to increment a variable in a page template. Here´s the 
> general idea in my code: 
> 
> 
>  
 
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.
___
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 )


Re: [Zope] Increment In PT?

2007-07-30 Thread Andreas Jung



--On 30. Juli 2007 10:16:35 -0400 [EMAIL PROTECTED] wrote:


Hi;
I´m trying to increment a variable in a page template. Here´s the
general idea in my code:





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

pgptY4bmZjZNI.pgp
Description: PGP signature
___
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 )


[Zope] Increment In PT?

2007-07-30 Thread tonylabarbara
Hi;
I´m trying to increment a variable in a page template. Here´s the general idea 
in my code:




 







Now, all of that works...once. That is, it increments from 0 to 1, but not from 
1 to 2! Each time I pass through the td element, I need it to increment. I 
tried putting the tal definition in the td, but then it didn´t even increment 
once! What do?
TIA,
Tony


AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
___
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 )