Hi there,

Laurence Rowe wrote:
The code would get a session through:

 >>> Session = getUtility(IScopedSession, 'my-app')
 >>> session = Session()

The drawback is that this is more typing. You do a utility lookup and an instantiation as opposed to simply importing the scoped session when needed:

from myapplication import session


One topic we ran into during the megrok.kss discussion is doing multiple instances of the same application, each writing to a different database. You can't hardcode your database name in your application. I think sessions as local utilities would help us solve that problem, right?

What would be nice if we could do the 'from myapp import session' pattern and have it use the local utility infrastructure underneath somehow... Possible?



Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to