its metadata.bind .    the 0.4 transition guide at
http://www.sqlalchemy.org/trac/wiki/WhatsNewIn04 mentions it but it's not
as clearly written as it should be.



jo wrote:
>
> Hi all,
>
> I'm trying migrate from 0.3.10 to 0.4 and there's the following error:
>
> ...   engine  = database.metadata.engine
> AttributeError: 'MetaData' object has no attribute 'engine'
>
> I was reading the section "0.3 to 0.4 Migration" of
> http://www.sqlalchemy.org/docs/04/intro.html#overview_migration,
> but sincerly I didn't understand where engine is rigth now.
>
> ---------------------------------------------------------------------
>
> this is my old code:
> ---------------------------------------------------------------------
> from turbogears                         import database
> from sqlalchemy                         import *
> from sqlalchemy.ext.assignmapper        import assign_mapper
> from sqlalchemy.ext.selectresults       import SelectResultsExt
> database.bind_meta_data()
> session = database.session
> engine  = database.metadata.engine
> context = database.session.context
>
> user=Table('user',database.metadata,
>     Column('code', Unicode(6),primary_key=True,nullable=False),
>     Column('name', Unicode(200)),
>     Column('address', Unicode(200)),
>     )
>
> Please help me to migrate this code to 0.4.
>
> j
>
>
> >
>


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

Reply via email to