summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/declarative.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-05-24 10:17:54 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-05-24 10:17:54 -0400
commit227f7facd93a1e105bbe1822afd2f9606ad9b42d (patch)
tree964c94c3ab0cfc0d11273ae0e890e834763ccdfb /lib/sqlalchemy/ext/declarative.py
parentb39db078374e0accd838e9d25e01dd7138726ad8 (diff)
downloadsqlalchemy-227f7facd93a1e105bbe1822afd2f9606ad9b42d.tar.gz
- [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.
Diffstat (limited to 'lib/sqlalchemy/ext/declarative.py')
-rwxr-xr-xlib/sqlalchemy/ext/declarative.py9
1 files changed, 3 insertions, 6 deletions
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,