Starting a dtml-method in a python script
Hi, I ve got a problem: i want to start a dtml-method from a python script.normally it should work like this: container.dtmlmethod() but !!! i always get a "global name REQUEST is not defined error". in the dtml-method are some REQUEST.set calls and it always crashes when my program gets to one of this... if i start the dtml-method normally there are no problems ... so , how do i avoid this error ? Sebastian
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.
Sebastian Sippl wrote:
i want to start a dtml-method from a python script.normally it should work like this:
container.dtmlmethod()
but !!!
i always get a "global name REQUEST is not defined error".
in the dtml-method are some REQUEST.set calls and it always crashes when my program gets to one of this...
if i start the dtml-method normally there are no problems ...
seems there are defaults when calling dtml-methods from dtml-docs. http://www.zope.org/Members/michel/ZB/AppendixB.dtml says __call__(client=None, REQUEST={}, **kw) try container.dtmlmethod(None, REQUEST=REQUEST)
participants (3)
-
hans -
Oleg Broytmann -
Sebastian Sippl