]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- added optional __table_opts__ dictionary to ActiveMapper, will send kw options to
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Feb 2007 01:12:38 +0000 (01:12 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Feb 2007 01:12:38 +0000 (01:12 +0000)
Table objects [ticket:462]

CHANGES
lib/sqlalchemy/ext/activemapper.py

diff --git a/CHANGES b/CHANGES
index 2aa1ff228105b3e6a9e73caaadf02212a77282e1..95c22fc55b3451b19a17bb6ddbe8bb05f15a7aa8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -44,6 +44,8 @@
 - ext:
   - added distinct() method to SelectResults.  generally should only make a difference
   when using count().
+  - added optional __table_opts__ dictionary to ActiveMapper, will send kw options to 
+  Table objects [ticket:462]
 - mssql:
   - better support for NVARCHAR types added [ticket:298]
   - fix for commit logic on pymssql
index 769c70b836de8bb3030060c1860d01155eadde45..674cc9265408efa3cdae5aa450474ef98d9432f4 100644 (file)
@@ -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