[Zope] REQUEST.set question

Dylan Reinhardt zope at dylanreinhardt.com
Wed Dec 3 11:36:29 EST 2003


On Wed, 2003-12-03 at 04:06, Mark Ferguson wrote:
> I'm going through the code examples in the Zope Bible and I can't get the
> following to
> work:
> 
> I've created a Python(Script) called 'hello' with 'name' on the parameter
> list and the following script body -
>   return "Hello %s!" % name

So far so good.

> 
> and a DTML Document with -
>   <dtml-call "REQUEST.set('name', 'John')">
>   <dtml-var hello>

Although scripts *can* obtain variables from REQUEST, it is not the
correct way to pass arguments.  Try this:

<dtml-var "hello('John')">

-- or --

<dtml-call "REQUEST.set('name', hello('John'))">
<dtml-var name>

HTH,

Dylan





More information about the Zope mailing list