[Zope-dev] Calling DTML methods from Python
Evan Simpson
evan@4-am.com
Wed, 24 Nov 1999 12:40:24 -0600
Itamar Shtull-Trauring wrote:
> I want to run manage_tabs from a PythonMethod.
> So I do
>
> request = self.manage_tabs(_.None, _)
>
> but now manage_tabs doesn't know who filtered_manage_tabs is. So how do I
> call a dtml method so that it knows where it is and works correctly?
This needs a bit more context. Is this PythonMethod being called from
another object, or is it the target of the request? I ask because the
following works for me, if it is the target:
<params>self, REQUEST</params>
print self.standard_html_header(self, REQUEST)
print self.manage_tabs(self, REQUEST)
print '<h1>Test</h1>'
print self.standard_html_footer(self, REQUEST)
return printed
When called from a DTML Method with <dtml-var expr="do_tabs(this(), _)">, the
following also works:
<params>client, _</params>
return client.manage_tabs(client, _)
Cheers,
Evan @ 4-am