metadata _MUST_ be specified in 0.4

Issue #983 resolved
Former user created an issue

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'

Comments (2)

  1. Log in to comment