[Zope] Passing ZMySQL database connections to external methods. Possible ?

happyrhino@usa.net happyrhino@usa.net
29 Aug 99 04:20:25 MDT


Before looking at Zope, I had already invested a lot of time in CGI
scripts and so I've converted them all to external methods (replacing
print's with StringIO objects and returning StringIO.getvalue()).
But the only benefit of using Zope then seems to be that I'll
have PCGI instead of CGI.

It would be good if I could also benefit from the  persistent 
database connections. So, is it also possible to pass a Zope 
Database Connection object to an external method ? 
For example, I am using the ZMySQL database connection. It would be
super to pass that to an external method and still use the identical
syntax as the native Python MySQLmodule. (eg. ZMySQL.query(), 
ZMySQL.fetchrows() in place of DBH.query(), DBH.fetchrows().)
In fact, that would be like gaining all the advantages of Zope but 
with little rewriting of code !  Is it possible ? 

However, I don't think these results would be cached like ZQL methods,
would they ? Even so, it would still be a quick start until I have time 
to rewrite all of my scripts as ZSQL methods.

Sorry for all of the questions. There's a lot to learn.

TIA,

Henry
 

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1