From 841ea194bd7cf239323ee21320210fd6dc5c551d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 23 Apr 2012 18:59:17 -0400 Subject: - [removed] The legacy "mutable" system of the ORM, including the MutableType class as well as the mutable=True flag on PickleType and postgresql.ARRAY has been removed. In-place mutations are detected by the ORM using the sqlalchemy.ext.mutable extension, introduced in 0.7. The removal of MutableType and associated constructs removes a great deal of complexity from SQLAlchemy's internals. The approach performed poorly as it would incur a scan of the full contents of the Session when in use. [ticket:2442] --- lib/sqlalchemy/orm/identity.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'lib/sqlalchemy/orm/identity.py') diff --git a/lib/sqlalchemy/orm/identity.py b/lib/sqlalchemy/orm/identity.py index 59d121de9..bb5fbb6e8 100644 --- a/lib/sqlalchemy/orm/identity.py +++ b/lib/sqlalchemy/orm/identity.py @@ -10,7 +10,6 @@ from sqlalchemy.orm import attributes class IdentityMap(dict): def __init__(self): - self._mutable_attrs = set() self._modified = set() self._wr = weakref.ref(self) @@ -31,28 +30,18 @@ class IdentityMap(dict): if state.modified: self._modified.add(state) - if state.manager.mutable_attributes: - self._mutable_attrs.add(state) def _manage_removed_state(self, state): del state._instance_dict - self._mutable_attrs.discard(state) self._modified.discard(state) def _dirty_states(self): - return self._modified.union(s for s in self._mutable_attrs.copy() - if s.modified) + return self._modified def check_modified(self): """return True if any InstanceStates present have been marked as 'modified'.""" - if self._modified: - return True - else: - for state in self._mutable_attrs.copy(): - if state.modified: - return True - return False + return bool(self._modified) def has_key(self, key): return key in self -- cgit v1.2.1