Re: [Zope] Passing parameters to external methods
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
At 10:18 pm +0200 14/9/00, Dieter Maurer wrote:
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')">
Is *that* what this() does!! Enlightenment....aaah. tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
Tony McDonald wrote:
You may explicitly pass all parameters:
<dtml-if "extAccess(this(),'COM')">
Is *that* what this() does!!
this() generally = self (almost, maybe not quite, always :-S) and the above doesn't _always_ work, IME :-S cheers, Chris
participants (3)
-
Chris Withers -
Dieter Maurer -
Tony McDonald