[Zope] - Do I have to explicitely pass REQUEST to external function?

Brad Clements bkc@murkworks.com
Tue, 26 Jan 1999 22:50:25 -0400


I have an external python function, who's header starts like this:

def Toggle(self, var='a', optvar=None,trueval=None,
	falseval=None, REQUEST=None,RESPONSE=None):
    "Toggle Test based on cookies and URL"


(kindly ignore line wrapping)

I call it from dhtml, like this:

<!--#call "Toggle(var='TogA',optvar='rowcount',trueval=99,falseval=5,
	REQUEST=REQUEST,RESPONSE=RESPONSE)"-->

(again, no wrapping)

If I don't use REQUEST=REQUEST,RESPONSE=RESPONSE

I get read-only buffer, class  exception.

Is this the way it's expected to function?

I can also call this function as

<!--#if "Toggle(var='TogA', 
	 REQUEST=REQUEST,RESPONSE=RESPONSE)"-->

Same deal, must have REQUEST.

Is there any way I can avoid explicitely passing REQUEST and 
RESPONSE?




Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               ICQ: 14856937

We must come down from our heights, and leave our straight 
paths, for the byways and low places of life, if we would 
learn truths by strong contrasts; and in hovels, in forecastles, 
and among our own outcasts in foreign lands, see what has been 
wrought upon our fellow-creatures by accident, hardship, or vice. 
- Richard Henry Dana, Jr. 1836