On Thu, 05 Oct 2000 16:03:24 +0200, Pierre-Julien Grizel
<[EMAIL PROTECTED]> wrote:

>Correcting my earlier post, I'd "simply" like to have a way to get the _
>(namespace) variable in a product method.
>Currently, I use the following syntax :
>
><dtml-var "product.method (_, 'Hello, world !')">
>
>to pass _ to my product.
>
>It works, but..... Reminds me of the great times when my hammer was the
>dtml-method......
>
>
>
>
>Has anyone a way to acquire _ in a product without constrainging the
>user to pass it explicitly ??????

Have a look at

http://www.zope.org/Members/htrd/howto/FunctionTemplate

Its a wrapper object for python functions that gives them *exactly*
the same calling convention as dtml methods. I developed this as a way
to replace overworked dtml without having to modify every other bit of
dtml that called it.

define your function as

def my_method(self,_):
    stuff goes in here

to invoke it from dtml use <dtml-var my_method>



Toby Dickenson
[EMAIL PROTECTED]

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to