[Zope] Re: How to use a ZSQLMethod from a Python Script

Stefano Vedovelli spinwing@inwind.it
Fri, 3 May 2002 15:27:08 +0200


Hello

under zope 2.5.1, I have a folder called temp. In the folder I have a=20
connection object, a zsql method called test_sql and a python script=20
called test_zsql.

The script is:

from Products.PythonScripts.standard import html_quote
res =3D context.test_sql()
for name in res.names():
  print name

dict =3D res.data_dictionary()
for key in dict.keys():
  print dict[key]

return printed


Works good. Sure you do not have some other issues? Note that I run=20
under Linux and as far as I can see you run it under Windows.

regards
Stefano


On Friday 03 May 2002 13:47, zope-request@zope.org wrote:
> >Igor Leturia writes:
> > >   I want to call a ZSQLMethod from a Python Script. In Zope.org,
> > I > couldn't find a specific how-to on the subject, but
> > accidentally I found some other how-to's in which there are examples=20
> > that use ZSQLMethods > from Python scripts. It seemed very easy, so=20
I tried
> > it that way:
> > >     res =3D context.mysqlmethod()
> > >   It gives an error message, 'resource not found'.=20