[Zope-dev] Re: SQLAlchemy integration experiment

Martijn Faassen faassen at startifact.com
Wed Jun 18 04:17:42 EDT 2008


Martin Aspeli wrote:
[snip]
> Why can't it just be
> 
> getUtility(ISession)
> 
> ?

Because the internals won't let you. As I said in my reply, a Session is 
not quite like a local utility. Trying to pigeonhole it that way isn't 
easy. It'd need some clever component wizardry to make sessions be 
created on the fly, and cached per thread when you make this call.

Laurence's call is easy enough to implement. You could do it by 
registering my Session under the ISession interface as a utility, in 
fact. I don't see the point, though (and it's ugly).

Regards,

Martijn



More information about the Zope-Dev mailing list