Hi Shane,

Sorry, I missed your reply in the remaining messages on the sqlalchemy
list.

On Wed, 2010-06-23 at 13:24 -0700, Shane wrote:
> 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?

I don't have an account class, and in fact I don't know why I
capitalized Account in my email. In fact, the variable is called
account_table, so with declarative I would probably be Account.__table__
or something like that.

In fact I just ran the attached python code which works just fine.

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.de
http://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.

from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base

base = declarative_base()
class Account(base):
    __tablename__ = "accounts"
    id = Column(Integer, primary_key=True)
    name = Column(String)

engine = create_engine("sqlite:///:memory:", echo=True)
Account.__table__.create(engine)

Reply via email to