NameError problem with sequence-number
Hello, I can run the following code which runs fine: <dtml-in "_.range(0,5)"> <dtml-var sequence-number> </dtml-in> However adding quotes around sequence-number always gives me an error "Error Type: NameError Error Value: sequence". <dtml-in "_.range(0,5)"> <dtml-var "sequence-number"> </dtml-in> I need to use sequence-number inside of a python expression. Can anyone explain how to do this? thanks -Kevin __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
Hello,
I can run the following code which runs fine:
<dtml-in "_.range(0,5)"> <dtml-var sequence-number> </dtml-in>
However adding quotes around sequence-number always gives me an error "Error Type: NameError Error Value: sequence".
<dtml-in "_.range(0,5)"> <dtml-var "sequence-number"> </dtml-in>
<dtml-in "_.range(0,5)"> <dtml-var expr="_['sequence-number']"> </dtml-in> Or use Tino's underscore patch ( which changes the -'s to _'s ). The problem is inside an expr, it's trying to evaluate 'sequence' minus 'number', and is failing to find 'sequence'. me = { 'name' : 'Zachery Bir', 'email' : 'zbir@urbanape.com', 'voice' : '(804) 353-3742', 'url' : 'http://www.urbanape.com/' }
If you using regular "" expresions Zope is reading it as object sequence minus object number. Try this. <dtml-in "_.range(0,5)"> <dtml-var "_['sequence-number']> </dtml-in> --- Kevin L <kevinsl@yahoo.com> wrote:
Hello,
I can run the following code which runs fine:
<dtml-in "_.range(0,5)"> <dtml-var sequence-number> </dtml-in>
However adding quotes around sequence-number always gives me an error "Error Type: NameError Error Value: sequence".
<dtml-in "_.range(0,5)"> <dtml-var "sequence-number"> </dtml-in>
I need to use sequence-number inside of a python expression. Can anyone explain how to do this?
thanks
-Kevin
__________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
__________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
From: "Kevin L" <kevinsl@yahoo.com> To: <zope@zope.org> Sent: Friday, July 06, 2001 9:38 AM Subject: [Zope] NameError problem with sequence-number
Hello,
I can run the following code which runs fine:
<dtml-in "_.range(0,5)"> <dtml-var sequence-number> </dtml-in>
This must work. What Zope version are you using ? Andreas
Actually that works. It was the second bit of code that caused an error. But someone has already told me what's wrong. thanks -Kevin --- Andreas Jung <andreas@digicool.com> wrote:
From: "Kevin L" <kevinsl@yahoo.com> To: <zope@zope.org> Sent: Friday, July 06, 2001 9:38 AM Subject: [Zope] NameError problem with sequence-number
Hello,
I can run the following code which runs fine:
<dtml-in "_.range(0,5)"> <dtml-var sequence-number> </dtml-in>
This must work. What Zope version are you using ?
Andreas
__________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
ups, wrong answer...try <dtml-var "_.getitem('sequence-number')"> Andreas ----- Original Message ----- From: "Andreas Jung" <andreas@digicool.com> To: "Kevin L" <kevinsl@yahoo.com>; <zope@zope.org> Sent: Friday, July 06, 2001 10:45 AM Subject: Re: [Zope] NameError problem with sequence-number
From: "Kevin L" <kevinsl@yahoo.com> To: <zope@zope.org> Sent: Friday, July 06, 2001 9:38 AM Subject: [Zope] NameError problem with sequence-number
Hello,
I can run the following code which runs fine:
<dtml-in "_.range(0,5)"> <dtml-var sequence-number> </dtml-in>
This must work. What Zope version are you using ?
Andreas
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (5)
-
Andreas Jung -
Andreas Jung -
Kevin L -
Vid B -
zbir@urbanape.com