[Zope] Calling dtml method from external method

Evan Simpson evan@4-am.com
Tue, 18 Jan 2000 08:44:44 -0600


Philip Corp wrote:

> I need to access an external method via a URL which, in turn calls a
> DTML method with a list of arguments and I can't seem to figure out how.
> Any help would be much appreciated. Thanks

You can pass the DTML method to the external method, as in:

def callback(self, REQUEST, dtmlmeth):
    dtmlmeth(self, REQUEST, arg1 = 1, arg2 = 'foo')

Or you can acquire the method, as in:

def callback(self, REQUEST):
    self.adtmlthing(self, REQUEST, arg1 = 'bah')

In either case, you need to make sure you pass a proper client and
namespace as the first two arguments, and the rest as keyword arguments.

Cheers,

Evan @ 4-am