]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- The "resurrect" ORM event has been removed. This event hook had
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 25 Aug 2014 21:00:21 +0000 (17:00 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 25 Aug 2014 21:00:21 +0000 (17:00 -0400)
no purpose since the old "mutable attribute" system was removed
in 0.8.
fixes #3171

doc/build/changelog/changelog_10.rst
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/mapper.py

index ace9569602aae6d2968fe97b2d7b9e10d58d73a2..bff3652c58c88da4d486350e6781671c7aabb68b 100644 (file)
 .. changelog::
        :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
index aa99673badaa7ef8d0427d069b4c846943a9acfe..8edaa274492107e3a9ac26c80aab616d6beb1555 100644 (file)
@@ -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.
index f22cac329cead928be0d078862f396132235a345..aab28ee0c5702f87ebc7defd94fa5ecf1cf1153d 100644 (file)
@@ -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."""