summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-11-17 10:55:10 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-11-17 10:55:10 -0500
commitd3ca4156495af556e448a8d3f6d5884d08ab2f9b (patch)
treeab1ed2c1097595b3edf228c5297d3cff5ab8b6d1 /lib/sqlalchemy
parentc5ccedfdfd65ddbbc51779c92e6978b0b2123175 (diff)
downloadsqlalchemy-d3ca4156495af556e448a8d3f6d5884d08ab2f9b.tar.gz
- An error is raised if __table_args__ is not in tuple
or dict format, and is not None. [ticket:1972]
Diffstat (limited to 'lib/sqlalchemy')
-rwxr-xr-xlib/sqlalchemy/ext/declarative.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py
index dd2df63d3..3c6cab59a 100755
--- a/lib/sqlalchemy/ext/declarative.py
+++ b/lib/sqlalchemy/ext/declarative.py
@@ -999,6 +999,10 @@ def _as_declarative(cls, classname, dict_):
isinstance(obj, declarative_props)
):
table_args = cls.__table_args__
+ if not isinstance(table_args, (tuple, dict, type(None))):
+ raise exceptions.ArgumentError(
+ "__table_args__ value must be a tuple, "
+ "dict, or None")
if base is not cls:
inherited_table_args = True
elif class_mapped: