[Zope] Calling a dtml method from a product
hans
hans@beehive.de
Wed, 03 Apr 2002 15:54:05 +0100
Geoff Armstrong wrote:
> I'm now managing to call my dtml method from my python product; but
> the DTMLMethod needs to set some variables in the REQUEST object.
<dtml-call "REQUEST.set( 'yourname', yourvalue)">
> I know this must seem like a dumb question; but can you tell me how
> to pass an empty REQUEST object in the call, so the DTMLMethod can
> set and make use of these variables?
>
> __call__(myDTMLMethod, REQUEST???)
NOTE: better ask zope@zope.org, so all member may profit :-)
a) REQUEST is an object that seemingly behaves just like a python
dictionary
b) the __call__-method of DTMLMethod has REQUEST={},
so by default if no 2nd parameter is given, it is empty. Note that
DTMLMethods
are usually interpreted in the context (=namespace) of their caller.
c) the third parameter **kw is a sequence of keyword parameters.
--
-------------------------------------------------------------
Who's got only a hammer sees the world as a nail
hans augustin (software developer) hans@beehive.de
beehive elektronische medien GmbH http://www.beehive.de
phone: +49 30 847-82 0 fax: +49 30 847-82 299