On Wed, Aug 11, 2010 at 8:10 AM, Ryan <[email protected]> wrote:

> Good to know it's not somewhere in the Pylons environment that I'm
> missing. Like Brennan, I've already created an engine in my model
> initializer, so still seems like I should be able to get at it
> somehow.
>

He means he uses something like this

def init_model(engine):
     ...
     meta.engine = engine

So later he can use it as meta.engine

I've checked SQLAlchemy code, it keeps engine instance in closure namespace
and it cannot be easily accessed from sessionmaker, and Pylons does not put
engine into any kind of globals. So you can use that meta.engine hack or add
new engine global (or put it in app_globals).

-- 
With best regards,
Daniel Kluev

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