name error : global name 'day' is not defined
Hi, One of my major problems in using zope now is to store value in a var for future use. I was able to get value for variable 'day' from my table through this: <dtml-in SQLgetDay> <dtml-call "REQUEST.set('day', day)"> <dtml-var day> </dtml-in> This actually displayed the value of day with <dtml-var day> on this page. Meanwhile it keeps on giving me the error below each time I reffered to 'day' subseqeuently. Even though I defined cookies for variable 'day' which I called from the standard-html-header of those pages where 'day' is been refferenced. Error Type: NameError Error Value: global name 'day' is not defined. Kindly tell me what i am doing wrong. ===== Hamzat kamaldeen Ishola Dnet Systems Limited 223 Ikorodu Road, Lagos. 234 1 7749381, 234 08033011305 __________________________________________________ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/
Hi,
One of my major problems in using zope now is to store value in a var for future use.
I was able to get value for variable 'day' from my table through this:
<dtml-in SQLgetDay> <dtml-call "REQUEST.set('day', day)"> <dtml-var day> </dtml-in>
This actually displayed the value of day with <dtml-var day> on this page.
Meanwhile it keeps on giving me the error below each time I reffered to 'day' subseqeuently. Even though I defined cookies for variable 'day' which I called from the standard-html-header of those pages where 'day' is been refferenced.
Error Type: NameError Error Value: global name 'day' is not defined.
Kindly tell me what i am doing wrong.
Hamzal -- First of all, your code above could simply be: <dtml-in SQLgetDay> <dtml-var day> </dtml-in> No need to put day in the REQUEST object unless you want to use it outside the <dtml-in> loop. When you say that you want to use it subsequently, it sounds like you mean on different web requests, so, yes, setting it as a cookie (or in Zope 2.5, as a SESSION variable) would be the right approach. Can you post the complete code to how you're setting it as a cookie and how you're trying to read it? - Joel
Hamzal Kamal wrote:
I was able to get value for variable 'day' from my table through this:
<dtml-in SQLgetDay> <dtml-call "REQUEST.set('day', day)"> <dtml-var day> </dtml-in>
This actually displayed the value of day with <dtml-var day> on this page.
You are iterating over a list of objects, and every time you set 'day' in the REQUEST object. Are you shure that it also happens correctly with the last object? regards Max M
participants (3)
-
Hamzal Kamal -
Joel Burton -
Max M