Mike Bayer  committed 14634cc

more migration notes

  • Participants
  • Parent commits 88b9e45

Comments (0)

Files changed (2)

File doc/build/changelog/migration_08.rst

 :ticket:`2438` :ticket:`1106`
+Events Can Be Applied to Unmapped Superclasses
+Mapper and instance events can now be associated with an unmapped
+superclass, where those events will be propagated to subclasses
+as those subclasses are mapped.   The ``propagate=True`` flag
+should be used.  This feature allows events to be associated
+with a declarative base class::
+    from sqlalchemy.ext.declarative import declarative_base
+    Base = declarative_base()
+    @event.listens_for("load", Base, propagate=True)
+    def on_load(target, context):
+        print "New instance loaded:", target
+    # on_load() will be applied to SomeClass
+    class SomeClass(Base):
+        __tablename__ = 'sometable'
+        # ...
+Declarative Distinguishes Between Modules/Packages
+A key feature of Declarative is the ability to refer
+to other mapped classes using their string name.   The
+registry of class names is now sensitive to the owning
+module and package of a given class.   The classes
+can be referred to via dotted name in expressions::
+    class Snack(Base):
+        # ...
+        "peanuts":relationship("nuts.Peanut",
+                primaryjoin="nuts.Peanut.snack_id ==")
+The resolution allows that any full or partial
+disambiguating package name can be used.   If the
+path to a particular class is still ambiguous,
+an error is raised.
 New DeferredReflection Feature in Declarative
+Repaired the Event Targeting of :class:`.InstrumentationEvents`
+The :class:`.InstrumentationEvents` series of event targets have
+documented that the events will only be fired off according to
+the actual class passed as a target.  Through 0.7, this wasn't the
+case, and any event listener applied to :class:`.InstrumentationEvents`
+would be invoked for all classes mapped.  In 0.8, additional
+logic has been added so that the events will only invoke for those
+classes sent in.  The ``propagate`` flag here is set to ``True``
+by default as class instrumentation events are typically used to
+intercept classes that aren't yet created.
 No more magic coercion of "=" to IN when comparing to subquery in MS-SQL
 Fixed the behavior of :meth:`.Session.is_modified`
 The :meth:`.Session.is_modified` method accepts an argument
 ``passive`` which basically should not be necessary, the

File doc/build/glossary.rst

+    descriptors
         In Python, a descriptor is an object attribute with “binding behavior”, one whose attribute access has been overridden by methods in the `descriptor protocol <>`_.
         Those methods are __get__(), __set__(), and __delete__(). If any of those methods are defined
         for an object, it is said to be a descriptor.