[Zope] Passing parameters to external methods

Andy McKay andym@ActiveState.com
Wed, 13 Sep 2000 15:29:03 -0700


Ive always sent through the REQUEST with no problem, <dtml-var
"externalmethod(REQUEST)"> if you can do that.

----- Original Message -----
From: "Andreas Pauley" <andreasp@qbcon.com>
To: "Zope" <zope@zope.org>
Sent: Wednesday, September 13, 2000 2:49 PM
Subject: [Zope] Passing parameters to external methods


> Hi,
> 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
>
> In the following dtml code, the following statement (with the SQL
> method) works fine:
>
> <dtml-if "sqlAccess(accttype_cde='COM')">
>  <b>sqlAccess returned something</b>
> </dtml-if>
>
> This statement, referencing my external method but using the same syntax
> as with the sql method, gives lots of headaches:
>
> <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
>
>
> Anybody any ideas?
>
> Thanks,
> Andreas.
>
> --
> In a world without fences, who needs gates?
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>