[Zope-DB] Problem with container in External Method

hawelek_tlen hawelek at tlen.pl
Tue Jun 22 13:00:51 EDT 2004


Hi,
I have Problem with External Method, I try to execute the same code like in Python script:
connection=container.restrictedTraverse('MySqlCon')
 connection.manage_open_connection()

in External Method:

def onAddExtMethod():

 connection=container.restrictedTraverse('MySqlCon')
 connection.manage_open_connection()

and I get always the same error:


Error Type: NameError
Error Value: global name 'container' is not defined

so my question, how can I refere to "conteiner" or "context" in External Method?

thanks for help,
best regards,

Adam  



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-db/attachments/20040622/9acc885d/attachment.html


More information about the Zope-DB mailing list