[Zope] Starting a dtml-method in a python script

Oleg Broytmann Oleg Broytmann <phd@phd.pp.ru>
Wed, 13 Feb 2002 17:57:35 +0300


On Wed, Feb 13, 2002 at 03:45:20PM +0100, Sebastian Sippl wrote:
> container.dtmlmethod()
> 
> i always get a "global name REQUEST is not defined error".
> 
> if i start the dtml-method normally there are no problems ...

   You were beaten by the DTML magic. When you call <dtml-var amethod>,
Zope automagically passes two additional parameters, as if you call it
<dtml-var "amethod(this(), REQUEST)">. So in you python script you should
call container.amethod(container, container.REQUEST).

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.