From: Mike Bayer Date: Sun, 3 Aug 2008 16:52:31 +0000 (+0000) Subject: a correction to the recent should_exclude change. should_exclude is a little mixed X-Git-Tag: rel_0_5beta3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=312647647d242d903b38cc9144c9c7b92cc2da03;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git a correction to the recent should_exclude change. should_exclude is a little mixed 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. --- diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 1fd49e7b3f..41908e8327 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -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