Re: Wish list (was Re: Invalid cursor state)

"Charlie Clark" <[email protected]>
Newsgroups gmane.comp.python.egenix.user
Organization eGenix.com
Message-ID <[email protected]>
Am 14.07.2009, 19:24 Uhr, schrieb Charlie Clark <[email protected]>:

> 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/


_______________________________________________________________________
eGenix.com User Mailing List                     http://www.egenix.com/
https://www.egenix.com/mailman/listinfo/egenix-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.