>
>
> I have an engine and things work.  I'm trying to get to the engine
> object from my accounts.py file so that I can instantiate a table
> object using sqlalchemy's reflection  "autoload_with=engine".  I guess
> the better way to have phrased my question would have been "what do I
> need to import to get to engine in my model/accounts.py file.
>
>
The engine and metadata both live in <yoursite>.model.meta, so typically I
use:

    from <yoursite>.model import meta

then use meta.engine, meta.metadata, and meta.Session()

In your accounts.py file, you can change your import to:

    from meta import metadata, engine

and change the autoload_with argument from "metadata.engine" to just
"engine"

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