[Zope] Python scripts - DB connection question...

Phil Harris phil.harris@zope.co.uk
Wed, 4 Jul 2001 23:05:44 +0100


I would have thought that the only change would need to be to change 'self'
to 'context'.

----- Original Message -----
From: "Lee" <lee.reilly@ntlworld.com>
To: <zope@zope.org>
Sent: Wednesday, July 04, 2001 10:49 PM
Subject: [Zope] Python scripts - DB connection question...


> Hi there,
>
> I haven't used Zope for a few months - I'm now using Python scripts
> instead of the Python method product. They don't appear to be too
> dissimilar, but I'm having a little trouble trying to execute an SQL
> query from a script. In a Python method it would be something like:
>
>     db_conn = self.Gadfly_database_connection()
>     // generate SQL
>     result=db_conn.query(updatePersonSQL)
>
> This doesn't work in a script though. Could someone how to estabish a
> connection and execute a query?
>
> Thanks in advance.
>
> - Best regards,
>
> Lee
>
>
>
> _______________________________________________
> 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 )