summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/identity.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-23 18:59:17 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-23 18:59:17 -0400
commit841ea194bd7cf239323ee21320210fd6dc5c551d (patch)
tree0da6b6ae37d5def93b84e06afd451f50716c6caf /lib/sqlalchemy/orm/identity.py
parent101da94e1282a410557784272bda58222ac048b4 (diff)
downloadsqlalchemy-841ea194bd7cf239323ee21320210fd6dc5c551d.tar.gz
- [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]
Diffstat (limited to 'lib/sqlalchemy/orm/identity.py')
-rw-r--r--lib/sqlalchemy/orm/identity.py15
1 files changed, 2 insertions, 13 deletions
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