]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
a correction to the recent should_exclude change. should_exclude is a little mixed
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 3 Aug 2008 16:52:31 +0000 (16:52 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 3 Aug 2008 16:52:31 +0000 (16:52 +0000)
up as to when it honors "column_prefix" and when it doesn't, depending on whether or not
the prop is coming from a column name or from an inherited class.  Will need more testing
to uncover potential issues here.

lib/sqlalchemy/orm/mapper.py

index 1fd49e7b3fc06976a8cef5f6e3c9340737703766..41908e832739b2ee83cecde377ceaad6ba1e24cf 100644 (file)
@@ -692,6 +692,9 @@ class Mapper(object):
         for column in self.mapped_table.columns:
             if column in self._columntoproperty:
                 continue
+
+            if self._should_exclude(column.key, local=self.local_table.c.contains_column(column)):
+                continue
                 
             column_key = (self.column_prefix or '') + column.key
 
@@ -701,8 +704,7 @@ class Mapper(object):
                 if column in mapper._columntoproperty:
                     column_key = mapper._columntoproperty[column].key
             
-            if not self._should_exclude(column_key, local=self.local_table.c.contains_column(column)):
-                self._compile_property(column_key, column, init=False, setparent=True)
+            self._compile_property(column_key, column, init=False, setparent=True)
 
         # do a special check for the "discriminiator" column, as it may only be present
         # in the 'with_polymorphic' selectable but we need it for the base mapper