On 2/11/2011 2:30 AM, Rob Miller wrote:
> This is untested, but i think you could do something like this in your 
> startup code::
>
>   from pyramid.registry import global_registry
>   global_registry.pool = PooledDB(...)
>
> Then in your view code, or anywhere you have a request object, you should be 
> able to get at it via `request.registry.pool`.

It seems to have been even easier than that.

config = Configurator()
config.registry.dbpool = DBUtils.PooledDB(...)

then in the view...

conn = request.registry.dbpool.connection(shareable=False)

Thanks for pointing the way to the registry!

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to