summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-08-25 17:00:21 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-08-25 17:00:21 -0400
commitbe2351481fdb83d1ed02a717ecc7741a19c73f62 (patch)
treee9906569e25a259fe230c9858daae7346fd162c1
parentb1aa0edf81680fac020bedb82ea8f8a7e8443f4b (diff)
downloadsqlalchemy-be2351481fdb83d1ed02a717ecc7741a19c73f62.tar.gz
- The "resurrect" ORM event has been removed. This event hook had
no purpose since the old "mutable attribute" system was removed in 0.8. fixes #3171
-rw-r--r--doc/build/changelog/changelog_10.rst8
-rw-r--r--lib/sqlalchemy/orm/events.py12
-rw-r--r--lib/sqlalchemy/orm/mapper.py11
3 files changed, 8 insertions, 23 deletions
diff --git a/doc/build/changelog/changelog_10.rst b/doc/build/changelog/changelog_10.rst
index ace956960..bff3652c5 100644
--- a/doc/build/changelog/changelog_10.rst
+++ b/doc/build/changelog/changelog_10.rst
@@ -17,6 +17,14 @@
:version: 1.0.0
.. change::
+ :tags: bug, orm
+ :tickets: 3171
+
+ The "resurrect" ORM event has been removed. This event hook had
+ no purpose since the old "mutable attribute" system was removed
+ in 0.8.
+
+ .. change::
:tags: bug, sql
:tickets: 3169
diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py
index aa99673ba..8edaa2744 100644
--- a/lib/sqlalchemy/orm/events.py
+++ b/lib/sqlalchemy/orm/events.py
@@ -293,18 +293,6 @@ class InstanceEvents(event.Events):
"""
- def resurrect(self, target):
- """Receive an object instance as it is 'resurrected' from
- garbage collection, which occurs when a "dirty" state falls
- out of scope.
-
- :param target: the mapped instance. If
- the event is configured with ``raw=True``, this will
- instead be the :class:`.InstanceState` state-management
- object associated with the instance.
-
- """
-
def pickle(self, target, state_dict):
"""Receive an object instance when its associated state is
being pickled.
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index f22cac329..aab28ee0c 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -1127,7 +1127,6 @@ class Mapper(InspectionAttr):
event.listen(manager, 'first_init', _event_on_first_init, raw=True)
event.listen(manager, 'init', _event_on_init, raw=True)
- event.listen(manager, 'resurrect', _event_on_resurrect, raw=True)
for key, method in util.iterate_attributes(self.class_):
if isinstance(method, types.FunctionType):
@@ -2762,16 +2761,6 @@ def _event_on_init(state, args, kwargs):
instrumenting_mapper._set_polymorphic_identity(state)
-def _event_on_resurrect(state):
- # re-populate the primary key elements
- # of the dict based on the mapping.
- instrumenting_mapper = state.manager.info.get(_INSTRUMENTOR)
- if instrumenting_mapper:
- for col, val in zip(instrumenting_mapper.primary_key, state.key[1]):
- instrumenting_mapper._set_state_attr_by_column(
- state, state.dict, col, val)
-
-
class _ColumnMapping(dict):
"""Error reporting helper for mapper._columntoproperty."""