zzzeek / test_sqlalchemy

0 stars 0 forks source link

metadata _MUST_ be specified in 0.4 #983

Closed sqlalchemy-bot closed 16 years ago

sqlalchemy-bot commented 16 years ago

Issue created by Anonymous


Previously in version 0.3 you could do,

t = Table('test', Column('a', Integer))

and the table would get bound to the default_metadata.

It appears that 0.4 has removed the default_metadata and you now MUST specify a metadata. This is not documented in the SQL migration guide and you get this cryptic error,

  File "/home/tim/oss/tp/tpserver-py/tp/server/bases/Message.py", line 21, in <module>
    class Message(SQLBase):
  File "/home/tim/oss/tp/tpserver-py/tp/server/bases/Message.py", line 38, in Message
    ForeignKeyConstraint(['game']('game'), ['game.id']('game.id')),
  File "/var/lib/python-support/python2.5/sqlalchemy/schema.py", line 95, in __call__
    table = metadata.tables[key](key)
AttributeError: 'Column' object has no attribute 'tables'
sqlalchemy-bot commented 10 years ago

Michael Bayer (zzzeek) wrote:


Removing milestone: 0.4.xx (automated comment)

sqlalchemy-bot commented 16 years ago

Michael Bayer (zzzeek) wrote:


note added in 8fee8e963de1fe050c79419dc2b176e8135ca448 and is up on the site.

sqlalchemy-bot commented 10 years ago

Changes by Michael Bayer (zzzeek): removed "0.4.xx" milestone

sqlalchemy-bot commented 16 years ago

Changes by Michael Bayer (zzzeek): set state to "resolved"