may now be a mix of lists and tuples. (Previously members
were always lists.)
+ - Session.delete() adds the given object to the session if
+ not already present. This was a regression bug from 0.4
+ [ticket:1150]
+
- The `echo_uow` flag on `Session` is deprecated, and unit-of-work
logging is now application-level only, not per-session level.
raise sa_exc.InvalidRequestError(
"Object '%s' already has an identity - it can't be registered "
"as pending" % mapperutil.state_str(state))
+
self._attach(state)
if state not in self._new:
self._new[state] = state.obj()
"different identity" % (mapperutil.state_str(state),
state.key))
- self._deleted[state] = state.obj()
self._attach(state)
+ self._deleted[state] = state.obj()
+ self.identity_map.add(state)
def _attach(self, state):
if state.session_id and state.session_id is not self.hash_key:
u2 = s2.query(User).get(user.id)
self.assertRaisesMessage(sa.exc.InvalidRequestError, "already persisted with a different identity", s.delete, u2)
+ s.expunge(user)
+ assert user not in s
s.delete(user)
+ assert user in s
+
s.flush()
assert user not in s
assert s.query(User).count() == 0