From 34f26ee255bf64cf6de6fb9a5f1285b696fa4bbd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 9 Feb 2011 15:14:54 -0500 Subject: - Fixed bug where a column with a SQL or server side default that was excluded from a mapping with include_properties or exclude_properties would result in UnmappedColumnError. [ticket:1995] --- lib/sqlalchemy/orm/mapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index db445076c..a6d2c95f5 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -1937,7 +1937,8 @@ class Mapper(object): if postfetch_cols: state.expire_attributes(state.dict, [self._columntoproperty[c].key - for c in postfetch_cols] + for c in postfetch_cols if c in + self._columntoproperty] ) # synchronize newly inserted ids from one table to the next -- cgit v1.2.1