[Zope] "global name 'REQUEST' is not defined"

Joseph A Knapka jknapka@earthlink.net
Sun, 10 Feb 2002 19:32:39 +0000


Hello, all,

Once again, it seems I must be misunderstanding something
very basic. I have a DTML method that's being called from
a DTML document, and it contains the code:

<dtml-if expr="REQUEST.get(field_var)">
...
</dtml-if>

where field_var is a dtml variable that has been set to
the name of another dtml variable that certainly exists
in the parent document. For example, field_var == "lastname",
and the parent DTML document has either received
"lastname=Blah" in its request, or has done
"REQUEST.set('lastname','')" if not. But the code above
yeilds an error:

"global name 'REQUEST' is not defined".

Since it's defined in the parent document, shouldn't it
also be defined for the DTML method? According to "The
Book of Zope" the REQUEST object is defined "for the
duration of the web request"; surely that must include
the invocation of DTML methods within the target
document?

Thanks in advance,

-- Joe
"I should like to close this book by sticking out any part of my neck
 which is not yet exposed, and making a few predictions about how the
 problem of quantum gravity will in the end be solved."
 --- Physicist Lee Smolin, "Three Roads to Quantum Gravity"