[Zope-dev] Using db_connections from Zope products

Jim Penny jpenny@universal-fasteners.com
Wed, 20 Jun 2001 13:30:38 -0400


On Wed, Jun 20, 2001 at 09:56:23AM -0700, Tom Brown wrote:
> Thanks fo the info!  I had seen those How-Tos... but
> was really asking.. How can I use APIs directly
> instead of having an External ZSQL method.  I have
> created a product and would like to be able to do sql
> queries in order to populate members of my class.  For
> this example, I have the creation of  a selection box
> as a member and the options will be generated by a
> select statement.


> I have gone through the product creation how to and
> was able to add, etc, my object.  I can display html,
> make dtml on the fly, etc.. from an object, just
> wanted to do a query as well.   .. would like to be
> able to do something like the Connection class without
> management interface, etc, or use pieces, just not
> sure how

You want to recreate all of the machinery of ZSQL methods yourself?
Well, actually it can be done if your database supports some
reasonable API, like the python DB-SIG DB-API 2.0.

But you are creating a fair amount of work for yourself.
Just use a ZSQL method and be happy.  (It will probably
make your site more secure if you use ZSQL, as well, as
you will not have to worry as much about argument quoting).

Jim