Wish list (was Re: [egenix-users] Invalid cursor state)

Charlie Clark charlie at egenix.com
Thu Jul 16 23:32:00 CEST 2009


Am 14.07.2009, 19:24 Uhr, schrieb Charlie Clark <charlie at egenix.com>:

> If we're in wish-list mode, a Zope 3 implementation would be handy as  
> well. All the new code we're developing is Zope 3-style (using browser  
> views and the component architecture), and digging around in the ZODB to  
> pull out a ZSQL method hooked up to an mxODBCZopeDA instance living in  
> content space simply isn't very nice. I'd like to be able to register a  
> database connection as a named utility (configured through ZCML or  
> optionally as a persistent item in the ZODB), and just pass it SQL to  
> execute.

Dan,

to come back to this. You want something a bit like this:

class DatabaseConnection(Persistent):
	implements(IDatabaseConnection)

registered locally and called as a named utility

db = getUtility(IDatabaseConnection, u"the specific connection")()
db.execute("INSERT (gromit, doodah, wotsit) INTO thingy (?, ?, ?)",  
(*args))

Charlie
-- 
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


    eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611
                http://www.egenix.com/company/contact/



More information about the egenix-users mailing list