]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- The 'info' attribute of Column is copied during
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 14 Nov 2010 17:42:34 +0000 (12:42 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 14 Nov 2010 17:42:34 +0000 (12:42 -0500)
Column.copy(), i.e. as occurs when using columns
in declarative mixins.  [ticket:1967]

CHANGES
lib/sqlalchemy/schema.py
test/engine/test_metadata.py

diff --git a/CHANGES b/CHANGES
index 7b8749a3f513a15ead97421b8009775dc17de820..7f15effc1674b425760a685bad7339413d1ac10f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -23,6 +23,11 @@ CHANGES
   - Fixed bug regarding "subqueryload" strategy whereby
     strategy would fail if the entity was an aliased()
     construct.  [ticket:1964]
+
+- sql
+  - The 'info' attribute of Column is copied during 
+    Column.copy(), i.e. as occurs when using columns
+    in declarative mixins.  [ticket:1967]
     
 - engine
   - Implemented sequence check capability for the C 
index 8e937968d0b0c4190a8d8b13b4edbfbef15c3fec..a332cec36154300658e4cd08d39cf2cbb935db09 100644 (file)
@@ -908,6 +908,7 @@ class Column(SchemaItem, expression.ColumnClause):
                 server_default=self.server_default,
                 onupdate=self.onupdate,
                 server_onupdate=self.server_onupdate,
+                info=self.info,
                 *args
                 )
         if hasattr(self, '_table_events'):
index 528d56244f33fe853187f390e408f80aed16474c..b2250c808f38d5dd9c813828077d73a24ef776ba 100644 (file)
@@ -52,10 +52,11 @@ class MetaDataTest(TestBase, ComparesTables):
             Column(Integer(), ForeignKey('bat.blah')),
             Column('bar', Integer(), ForeignKey('bat.blah'), primary_key=True,
                                                             key='bar'),
+            Column('bar', Integer(), info={'foo':'bar'}),
         ]:
             c2 = col.copy()
             for attr in ('name', 'type', 'nullable', 
-                        'primary_key', 'key', 'unique'):
+                        'primary_key', 'key', 'unique', 'info'):
                 eq_(getattr(col, attr), getattr(c2, attr))
             eq_(len(col.foreign_keys), len(c2.foreign_keys))
             if col.default: