From: Mike Bayer Date: Thu, 25 May 2006 18:20:39 +0000 (+0000) Subject: bind parameter conflict in _get() resolved X-Git-Tag: rel_0_2_0~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ce777d550a8736d04bf76cd904b5bc4fc3e96d6;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git bind parameter conflict in _get() resolved --- 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