- changed status to resolved
using DynamicMetaData and autoload=True leads to mysterious appfault
Issue #326
resolved
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)
-
repo owner -
repo owner - removed status
-
repo owner - changed status to open
-
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.
-
repo owner - changed status to resolved
ok much better, try changeset:1956
- Log in to comment
DynamicMetaData is certainly compatible with autoload=True if the metadata has been connected. I put an explicit error message in changeset:1954.