From: Ants Aasma Date: Tue, 1 Jul 2008 16:51:25 +0000 (+0000) Subject: Session.bind gets used as a default even when table/mapper specific binds are defined. X-Git-Tag: rel_0_5beta2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64a23962ee6c6c6745312c457de5fb4332961e97;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Session.bind gets used as a default even when table/mapper specific binds are defined. --- diff --git a/CHANGES b/CHANGES index 5f74037738..13ac302a15 100644 --- a/CHANGES +++ b/CHANGES @@ -30,6 +30,9 @@ CHANGES - Repaired `__str__()` method on Query. [ticket:1066] + - Session.bind gets used as a default even when table/mapper + specific binds are defined. + - sqlite - Modified SQLite's representation of "microseconds" to match the output of str(somedatetime), i.e. in that the diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 60b88cc0e0..2110f8826f 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -865,7 +865,8 @@ class Session(object): for t in sql_util.find_tables(clause): if t in self.__binds: return self.__binds[t] - elif self.bind: + + if self.bind: return self.bind if isinstance(clause, sql.expression.ClauseElement) and clause.bind: