On Friday 07 September 2007, Uwe C. Schroeder wrote:
> On Friday 07 September 2007, johnbraduk wrote:
> > When I try to use autoload=True  to access existing tables  I get the
> > following error with SQLAlchemy.  I see this has been reported before,
> > but I did not see a solution. Is there a fix?
> > Thanks
> > John Bradbury
> >
> > "This SchemaItem is not connected to any Engine or Connection."
> >
> > First lines from model.py  below:
> >
> > from datetime import datetime
> > from sqlalchemy import *
> > from turbogears.database import metadata, session
> > from sqlalchemy.ext.assignmapper import assign_mapper
> > from turbogears import identity
> > # The identity schema.
> >
> > transjobs_table = Table('JOBS',metadata, autoload=True)
>
> Add
>
> from turbogears.database import bind_meta_data, get_engine
> bind_meta_data()
> engine=get_engine()
>
> to the top of your model.py
>

Just noticed: probably you don't need the engine= line - I'm just using the 
engine directly for some queries that were just too tedious to set up with 
python syntax.

Uwe


--
Open Source Solutions 4U, LLC   1618 Kelly St
Phone:  +1 707 568 3056         Santa Rosa, CA 95401
Cell:   +1 650 302 2405         United States
Fax:    +1 707 568 6416

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to