Hi Torsten,

How would you define the Account class?  Calling create on my
DeclarativeBase Account object was one of the first things I tried,
but I keep getting:

AttributeError: type object 'Account' has no attribute 'create'

Maybe a version difference in sqlalchemy?

- Shane

On Jun 18, 10:22 am, Torsten Landschoff
<torsten.landsch...@dynamore.de> wrote:
> Hi Shane,
>
> On Thu, 2010-06-17 at 23:09 -0700, Shane wrote:
> > def upgrade():
> >    try:
> >            session.begin() # Start transaction, but tables are always 
> > committed
> > (See below)
>
> > DeclarativeBase.metadata.tables[Account.__tablename__].create(migrate_engine)
>
> Hmm, that looks overly complicated to me. I am using the create method
> on the Table as well to do this, but it works fine without a session
> just using a plain connection:
>
>     engine = create_engine(...)
>     conn = engine.connect()
>     with conn.begin():
>         Account.create(conn)
>         # for testing...
>         conn.rollback()
>
> I did not create an ORM session before updating the tables as the schema
> might not match the mapped classes before updating.
>
> Greetings, Torsten
>
> --
> DYNAmore Gesellschaft fuer Ingenieurdienstleistungen mbH
> Torsten Landschoff
>
> Office Dresden
> Tel: +49-(0)351-4519587
> Fax: +49-(0)351-4519561
>
> mailto:torsten.landsch...@dynamore.dehttp://www.dynamore.de
>
> Registration court: Mannheim, HRB: 109659, based in Karlsruhe,
> Managing director:  Prof. Dr. K. Schweizerhof, Dipl.-Math. U. Franz

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to