From: Mike Bayer Date: Sun, 21 Jan 2007 21:03:37 +0000 (+0000) Subject: oops, change from yesterday fails the zblog tests...now i understand ! X-Git-Tag: rel_0_3_4~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30184335926bcbda72878df5119f958f4579e4f9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git oops, change from yesterday fails the zblog tests...now i understand ! --- diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index dc2965ab37..df09402bf7 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -691,7 +691,12 @@ class Mapper(object): 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, [])