[Zope] Re: Cannot pass parameters to Externa Method From inside a DTML Method

Tres Seaver tseaver at palladion.com
Fri Aug 5 08:08:25 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Apostolou wrote:

> The problem know is that, althought the params of the
> GetQueryParamsDTML is passed to ShowResults through
> the REQUEST, the TestODBCEM does not use them. Instead
> the code is always using the defValues of its def
> line.
> When i was calling ./TestODBC from GetQueryParamsDTML 
> it was using the parameters i was submiting.
> 
> I tried to change the follong line of ShowResults :
> <dtml-in TestODBCEM>
> to:
> <dtml-in expr="TestODBCEM('<dtml-var sysDSN>',
> '<dtml-var usr>', '<dtml-var mypass>', '<dtml-var
> sSQL>')">
> 
> but this one gives me an AttributeError ('str' object
> has no attribute 'id').

inside 'expr=".,."', you are writing a Python expression, and thus don't
need the '<dtml-var>' bit.  Try:

  <dtml-in expr="TextODBCEM(myDSN, usr, mypass, aSQL)">

I would recommend investing in a good Zope reference, e.g. the Zope 2.7
version of "The Zope Book":

  http://www.plope.com/Books/2_7Edition

Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC81a5+gerLs4ltQ4RAtiJAJ4+uQuhIMBtUACVaJ1UeLp1o0D+wACcDTo9
U1IszKaOUHyjyeeEA+cJjL4=
=OD7J
-----END PGP SIGNATURE-----



More information about the Zope mailing list