From 227f7facd93a1e105bbe1822afd2f9606ad9b42d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 24 May 2012 10:17:54 -0400 Subject: - [bug] Fixed bug in declarative whereby the precedence of columns in a joined-table, composite column (typically for id) would fail to be correct if the columns contained names distinct from their attribute names. This would cause things like primaryjoin conditions made against the entity attributes to be incorrect. Related to [ticket:1892] as this was supposed to be part of that, this is [ticket:2491]. Also in 0.7.8. --- lib/sqlalchemy/ext/declarative.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/sqlalchemy/ext') diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index 25dd72b24..893fc988d 100755 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -1388,11 +1388,9 @@ class _MapperConfig(object): if k in inherited_mapper._props: p = inherited_mapper._props[k] if isinstance(p, ColumnProperty): - # note here we place the superclass column - # first. this corresponds to the - # append() in mapper._configure_property(). - # change this ordering when we do [ticket:1892] - properties[k] = p.columns + [col] + # note here we place the subclass column + # first. See [ticket:1892] for background. + properties[k] = [col] + p.columns result_mapper_args = mapper_args.copy() result_mapper_args['properties'] = properties @@ -1401,7 +1399,6 @@ class _MapperConfig(object): def map(self): self.configs.pop(self.cls, None) mapper_args = self._prepare_mapper_arguments() - self.cls.__mapper__ = self.mapper_cls( self.cls, self.local_table, -- cgit v1.2.1