[Zope] indirect calling of methods with parameters

Bernd Worsch Bernd Worsch <bernd.worsch@frontsite.de>
Tue, 27 Mar 2001 11:21:18 +0200


Sorry, but this is above me head!

I'm trying to call a method that needs parameters indirectly. Well,
after reading some docs i believe to somehow understand how 
indirect calling of variables works. What's more, everything is fine
when no parameters are involved:

<dtml-let method="SomeMethod">
  <dtml-var method>
</dtml-let>

<dtml-let method="'SomeMethod'">
  <dtml-var "_[methode]">
</dtml-let>

Both Variants call SomeMethod, which is fine! On the other hand
i'm totally lost when parameters are involved. 

I for example tried to build my commandcall as a string. But using
_[] won't work as it naturally won't call the method but look for
an object with a kind of unusal name, which doesn't exist. It seems
like i need some kind of eval construct. Any suggestions?

Or for short: How do i change the following code to call method instead
of giving me an KeyError on the object named ParaMethod('lalala') ?  

<dtml-let method="'ParaMethod(\'lalala\')'">
  <dtml-var "_[method]">
</dtml-let> 

Thanks
Bernd

-- 

-----Bernd Worsch-----------bernd.worsch@frontsite.de--------