[Zope-DB] passing an handler to a python script

Dieter Maurer dieter@handshake.de
Mon, 25 Feb 2002 23:07:43 +0100

Giorgio Andreoletti - mentelocale writes:
 > ....
 > this is my problem: i'm writing a python script to handle the publishing of
 > some adv banners, using zope 2.5.0, postgresql 7.0.3, python 2.1.2, on my
 > linux slackware 2.4.17. I'm using psycopg as DB adapter.
 > everything is ok but the speed : the problem, i think, is due to the fact
 > that the script itself opens and closes a connection to the DB everytime
 > it's called; i'd like to pass the script something like an handle of a DB
 > connection created in zope, but i cannot realize how to pass this handle...
The easiest way would be to use a Z SQL Method inside your
Python Script.

I think you will find examples in the Zope book.
If not, you definitely find some in the mailing list archives.