diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-03 13:13:16 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-03 13:13:16 -0400 |
commit | 74c98bf182a1cac1ca1837da69e1c0550beaaab5 (patch) | |
tree | 4815d198d2aa4a6497330fb5d81e53bf4acfbb2d /lib/sqlalchemy/orm/session.py | |
parent | ff399ac75074916045410cedae72489cb60e8b50 (diff) | |
parent | c2a158c137ee07a146f02e5ee89ec42e486c6a37 (diff) | |
download | sqlalchemy-74c98bf182a1cac1ca1837da69e1c0550beaaab5.tar.gz |
Merge branch 'master' into ticket_1068
Diffstat (limited to 'lib/sqlalchemy/orm/session.py')
-rw-r--r-- | lib/sqlalchemy/orm/session.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index ffb8a4e03..5a4486eef 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -5,7 +5,7 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """Provides the Session class and related utilities.""" -from __future__ import with_statement + import weakref from .. import util, sql, engine, exc as sa_exc, event @@ -328,7 +328,7 @@ class SessionTransaction(object): subtransaction.commit() if not self.session._flushing: - for _flush_guard in xrange(100): + for _flush_guard in range(100): if self.session._is_clean(): break self.session.flush() @@ -605,7 +605,7 @@ class Session(_SessionClassMethods): SessionExtension._adapt_listener(self, ext) if binds is not None: - for mapperortable, bind in binds.iteritems(): + for mapperortable, bind in binds.items(): if isinstance(mapperortable, (type, Mapper)): self.bind_mapper(mapperortable, bind) else: @@ -1776,7 +1776,7 @@ class Session(_SessionClassMethods): Session. """ - return iter(list(self._new.values()) + self.identity_map.values()) + return iter(list(self._new.values()) + list(self.identity_map.values())) def _contains_state(self, state): return state in self._new or self.identity_map.contains_state(state) @@ -2139,13 +2139,13 @@ class Session(_SessionClassMethods): def deleted(self): "The set of all instances marked as 'deleted' within this ``Session``" - return util.IdentitySet(self._deleted.values()) + return util.IdentitySet(list(self._deleted.values())) @property def new(self): "The set of all instances marked as 'new' within this ``Session``." - return util.IdentitySet(self._new.values()) + return util.IdentitySet(list(self._new.values())) class sessionmaker(_SessionClassMethods): |