From 0ce777d550a8736d04bf76cd904b5bc4fc3e96d6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 25 May 2006 18:20:39 +0000 Subject: [PATCH] bind parameter conflict in _get() resolved --- lib/sqlalchemy/orm/query.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index ef26fee4f7..cfd89411a7 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -24,7 +24,7 @@ class Query(object): if not hasattr(mapper, '_get_clause'): _get_clause = sql.and_() for primary_key in self.mapper.pks_by_table[self.table]: - _get_clause.clauses.append(primary_key == sql.bindparam("pk_"+primary_key.key)) + _get_clause.clauses.append(primary_key == sql.bindparam("pk_"+primary_key._label)) self.mapper._get_clause = _get_clause self._get_clause = self.mapper._get_clause def _get_session(self): @@ -266,7 +266,7 @@ class Query(object): i = 0 params = {} for primary_key in self.mapper.pks_by_table[self.table]: - params["pk_"+primary_key.key] = ident[i] + params["pk_"+primary_key._label] = ident[i] # if there are not enough elements in the given identifier, then # use the previous identifier repeatedly. this is a workaround for the issue # in [ticket:185], where a mapper that uses joined table inheritance needs to specify -- 2.47.3