using DynamicMetaData and autoload=True leads to mysterious appfault

Issue #326 resolved
Former user created an issue

Doing something like:

    meta = DynamicMetaData()
    users_table = Table('users', meta, autoload=True)

will result in:

    exceptions.AttributeError: 'NoneType' object has no attribute 'reflecttable'"

because it's trying to use an engine that isn't set yet.

Naturally, you can't load the meta data without talking to the database, but users might not think of that (especially when they're just following along with the Pylons tutorial and simply add autload=True to the code ;). Instead of failing with a mysterious exception, this case should result in a readable exception that says that DynamicMetaData and autoload=True are incompatible.

Comments (5)

  1. Mike Bayer repo owner

    of course the str() function depends on MetaData returning None so this will be more complex to fix, rolled back the last commit.

  2. Log in to comment