1. idank
  2. sqlalchemy

Commits

Mike Bayer  committed 1e491a1

oops, change from yesterday fails the zblog tests...now i understand !

  • Participants
  • Parent commits 4cb85f9
  • Branches default

Comments (0)

Files changed (1)

File lib/sqlalchemy/orm/mapper.py

View file
             prop.set_parent(self)
             
         if isinstance(prop, ColumnProperty):
-            col = self.select_table.corresponding_column(prop.columns[0], keys_ok=False, raiseerr=True)
+            # relate the mapper's "select table" to the given ColumnProperty
+            col = self.select_table.corresponding_column(prop.columns[0], keys_ok=True, raiseerr=False)
+            # col might not be present! the selectable given to the mapper need not include "deferred"
+            # columns (included in zblog tests)
+            if col is None:
+                col = prop.columns[0]
             self.columns[key] = col
             for col in prop.columns:
                 proplist = self.columntoproperty.setdefault(col, [])