[Zope] Passing parameters to external methods

Dieter Maurer dieter@handshake.de
Thu, 14 Sep 2000 22:18:14 +0200 (CEST)


Andreas Pauley writes:
 > I need to pass some parameters to my external methods.
 > 
 > I have an external method that looks (somewhat) like this:
 > 
 > def extAccess(self, accttype_cde):
 >     return accttype_cde
 > 
 > ....
 >
 > <dtml-if "extAccess(accttype_cde='COM')">
 >   <b>The external method returned true</b>
 > </dtml-if>
 > 
 > I get the following error for the above statement:
 > Error Type: TypeError
 > Error Value: not enough arguments; expected 2, got 0

External methods try to be intelligent with respect
to parameter passing and sometimes they get it wrong.

You may explicitly pass all parameters:

  <dtml-if "extAccess(this(),'COM')">
    ....

This should work.


Dieter