From: Mike Bayer Date: Sat, 3 Sep 2005 07:07:06 +0000 (+0000) Subject: (no commit message) X-Git-Tag: rel_0_1_0~806 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b99a1f4c67cecc508ae519782dba23232558d01c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git --- diff --git a/lib/sqlalchemy/mapper.py b/lib/sqlalchemy/mapper.py index 67d0a031a4..a4d3ba638f 100644 --- a/lib/sqlalchemy/mapper.py +++ b/lib/sqlalchemy/mapper.py @@ -112,15 +112,13 @@ class Mapper(object): self.props[key] = prop if isinstance(prop, ColumnProperty): for col in prop.columns: - if col.original is not None: - col = col.original - proplist = self.columntoproperty.setdefault(col, []) + proplist = self.columntoproperty.setdefault(col.original, []) proplist.append(prop) # load properties from the main Selectable object, # not overriding those set up in the 'properties' argument for column in self.selectable.columns: - if self.columntoproperty.has_key(column): + if self.columntoproperty.has_key(column.original): continue prop = self.props.get(column.key, None) @@ -134,9 +132,7 @@ class Mapper(object): # its a ColumnProperty - match the ultimate table columns # back to the property - if column.original is not None: - column = column.original - proplist = self.columntoproperty.setdefault(column, []) + proplist = self.columntoproperty.setdefault(column.original, []) proplist.append(prop)