[Zope] ZSqlMethod and Brain Class

Delarue Christophe cdelarue@e-generis.com
Fri, 12 Apr 2002 18:16:33 +0200


This is my first Zope usage ...

I've an ODBC Connection for two tables :

FA
--
ref
name

Done
---
ref
correction=20

This Done table may not have a ref entry event if FA has.

To edit the FA, I've got a ZSqlMethod SQLQuery which take a `ref' as ar=
g.
I edit this by http://host/SQLQuery/Ref/3414/EditRef
the EditRef is a DtmlMethod which want to display something if there is=

data in the Done table.

Thus I choose to associate a Brain Class to SQLQuery in which I use a
ZSqlMethod SQLQueryDone which retrieve the full content of the Done tab=
le for a
given ref.

class Result:
   def treat(self):
       return self.SQLQueryDone(Ref=3Dself.Ref)

In the EditRef I've written :
<dtml-if treat>
  <dtml-with treat>
    <dtml-var correction>
  </dtml-with>
</dtml-if>

If execute the query, I've got an Error :

            Error Type: KeyError
            Error Value: correction

I suppose I've got a namespace problem. I do not understand.

thank's for any help.


NOTE : I've tried a SELECT xxx FROM xxx LEFT JOIN xxx but this is not
understood by the ZODBCDA driver.

--=20
Christophe DELARUE        E-Generis
Tel.: (+33) 299 842052 =A0=A0 Fax.: (+33) 299 639331
13, sq. du Chene Germain / 35510 Cesson-Sevigne / France
mailto:cdelarue@e-generis.com