1. idank
  2. sqlalchemy


Mike Bayer  committed 9996d0d

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.

  • Participants
  • Parent commits 848fe9b
  • Branches default

Comments (0)

Files changed (1)

File lib/sqlalchemy/orm/mapper.py

View file
         for column in self.mapped_table.columns:
             if column in self._columntoproperty:
+            if self._should_exclude(column.key, local=self.local_table.c.contains_column(column)):
+                continue
             column_key = (self.column_prefix or '') + column.key
                 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