[Zope] DTML: calling a method

Kevin Dangoor kid@kendermedia.com
Mon, 1 Nov 1999 13:41:18 -0500


Someone may have done a howto on this, but I'm not sure.

The basic format is:

<dtml-var "amethod(_.None, _, arg1='foo', arg2='bar')">

(The _.None is the target object for the method, and _ is the namespace. You
need to include these (most importantly, the namespace) so that the method
knows the context that it is being called in and has access to the normal
set of variables.)

Kevin

-----Original Message-----
From: Scott Lewis <csl@balticave.com>
To: zope@zope.org <zope@zope.org>
Date: Monday, November 01, 1999 12:02 AM
Subject: [Zope] DTML: calling a method


i have a string with a method name and another string with the
method arguments. currently the arguments string looks like this:
"arg1='foo', arg2='bar'" but this format can altered if necessary.

what is the DTML to call the method with the specified arguments?

e.g:
s1 = "amethod"
s2 = "arg1='foo', arg2='bar'"

without knowing the values of these strings until runtime, how do i
do the equivalent of:

<dtml-var "amethod(arg1='foo', arg2='bar')">