summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/activemapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-02-07 01:12:38 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-02-07 01:12:38 +0000
commit7b8cfa6ba1091b18f5b270d1cca0ad108aff23e2 (patch)
tree7877e466dfa9003a1fbf1a0a23c78f9e44ca823b /lib/sqlalchemy/ext/activemapper.py
parent6fac73b6998c5ebf4e8aa76194fff19273ea4c9d (diff)
downloadsqlalchemy-7b8cfa6ba1091b18f5b270d1cca0ad108aff23e2.tar.gz
- added optional __table_opts__ dictionary to ActiveMapper, will send kw options to
Table objects [ticket:462]
Diffstat (limited to 'lib/sqlalchemy/ext/activemapper.py')
-rw-r--r--lib/sqlalchemy/ext/activemapper.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ext/activemapper.py b/lib/sqlalchemy/ext/activemapper.py
index 769c70b83..674cc9265 100644
--- a/lib/sqlalchemy/ext/activemapper.py
+++ b/lib/sqlalchemy/ext/activemapper.py
@@ -208,6 +208,7 @@ class ActiveMapperMeta(type):
"__metadata__", metadata)
version_id_col = None
version_id_col_object = None
+ table_opts = {}
if 'mapping' in dict:
found_pk = False
@@ -228,6 +229,9 @@ class ActiveMapperMeta(type):
if '__version_id_col__' == name:
version_id_col = value
+
+ if '__table_opts__' == name:
+ table_opts = value
if name.startswith('__'): continue
@@ -261,10 +265,10 @@ class ActiveMapperMeta(type):
ActiveMapperMeta.metadatas.add(_metadata)
if not autoload:
- cls.table = Table(table_name, _metadata, *columns)
+ cls.table = Table(table_name, _metadata, *columns, **table_opts)
cls.columns = columns
else:
- cls.table = Table(table_name, _metadata, autoload=True)
+ cls.table = Table(table_name, _metadata, autoload=True, **table_opts)
cls.columns = cls.table._columns
# check for inheritence