diff options
Diffstat (limited to 'lib/sqlalchemy/ext')
| -rw-r--r-- | lib/sqlalchemy/ext/associationproxy.py | 6 | ||||
| -rwxr-xr-x | lib/sqlalchemy/ext/declarative.py | 27 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/mutable.py | 13 |
3 files changed, 27 insertions, 19 deletions
diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index 01a4a933f..cd9f0705a 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -141,7 +141,7 @@ class AssociationProxy(object): """The 'remote' :class:`.MapperProperty` referenced by this :class:`.AssociationProxy`. - New in 0.7.3. + .. versionadded:: 0.7.3 See also: @@ -157,7 +157,7 @@ class AssociationProxy(object): """The 'local' :class:`.MapperProperty` referenced by this :class:`.AssociationProxy`. - New in 0.7.3. + .. versionadded:: 0.7.3 See also: @@ -177,7 +177,7 @@ class AssociationProxy(object): sess.query(Parent).join(*Parent.proxied.attr) - New in 0.7.3. + .. versionadded:: 0.7.3 See also: diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index 893fc988d..d7a9c8deb 100755 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -509,10 +509,12 @@ before the class is built:: Using the Concrete Helpers ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -New helper classes released in 0.7.3 provides a simpler pattern for concrete inheritance. +Helper classes provides a simpler pattern for concrete inheritance. With these objects, the ``__declare_last__`` helper is used to configure the "polymorphic" loader for the mapper after all subclasses have been declared. +.. versionadded:: 0.7.3 + An abstract base can be declared using the :class:`.AbstractConcreteBase` class:: from sqlalchemy.ext.declarative import AbstractConcreteBase @@ -674,8 +676,7 @@ keys, as a :class:`.ForeignKey` itself contains references to columns which can't be properly recreated at this level. For columns that have foreign keys, as well as for the variety of mapper-level constructs that require destination-explicit context, the -:func:`~.declared_attr` decorator (renamed from ``sqlalchemy.util.classproperty`` in 0.6.5) -is provided so that +:func:`~.declared_attr` decorator is provided so that patterns common to many classes can be defined as callables:: from sqlalchemy.ext.declarative import declared_attr @@ -694,6 +695,9 @@ point at which the ``User`` class is constructed, and the declarative extension can use the resulting :class:`.Column` object as returned by the method without the need to copy it. +.. versionchanged:: > 0.6.5 + Rename 0.6.5 ``sqlalchemy.util.classproperty`` into :func:`~.declared_attr`. + Columns generated by :func:`~.declared_attr` can also be referenced by ``__mapper_args__`` to a limited degree, currently by ``polymorphic_on`` and ``version_id_col``, by specifying the @@ -931,7 +935,7 @@ Special Directives ``__declare_last__()`` ~~~~~~~~~~~~~~~~~~~~~~ -The ``__declare_last__()`` hook, introduced in 0.7.3, allows definition of +The ``__declare_last__()`` hook allows definition of a class level function that is automatically called by the :meth:`.MapperEvents.after_configured` event, which occurs after mappings are assumed to be completed and the 'configure' step has finished:: @@ -942,12 +946,14 @@ has finished:: "" # do something with mappings +.. versionadded:: 0.7.3 + .. _declarative_abstract: ``__abstract__`` ~~~~~~~~~~~~~~~~~~~ -``__abstract__`` is introduced in 0.7.3 and causes declarative to skip the production +``__abstract__`` causes declarative to skip the production of a table or mapper for the class entirely. A class can be added within a hierarchy in the same way as mixin (see :ref:`declarative_mixins`), allowing subclasses to extend just from the special class:: @@ -985,6 +991,8 @@ The tables themselves can then be created perhaps within distinct databases:: DefaultBase.metadata.create_all(some_engine) OtherBase.metadata_create_all(some_other_engine) +.. versionadded:: 0.7.3 + Class Constructor ================= @@ -1568,11 +1576,10 @@ class declared_attr(property): """Mark a class-level method as representing the definition of a mapped property or special declarative member name. - .. note:: - - @declared_attr is available as - ``sqlalchemy.util.classproperty`` for SQLAlchemy versions - 0.6.2, 0.6.3, 0.6.4. + .. versionchanged:: 0.6.{2,3,4} + ``@declared_attr`` is available as + ``sqlalchemy.util.classproperty`` for SQLAlchemy versions + 0.6.2, 0.6.3, 0.6.4. @declared_attr turns the attribute into a scalar-like property that can be invoked from the uninstantiated class. diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 5ca9727ec..2280e33f3 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -217,12 +217,13 @@ be assigned an object value which represents information "composed" from one or more columns from the underlying mapped table. The usual example is that of a geometric "point", and is introduced in :ref:`mapper_composite`. -As of SQLAlchemy 0.7, the internals of :func:`.orm.composite` have been -greatly simplified and in-place mutation detection is no longer enabled by -default; instead, the user-defined value must detect changes on its own and -propagate them to all owning parents. The :mod:`sqlalchemy.ext.mutable` -extension provides the helper class :class:`.MutableComposite`, which is a -slight variant on the :class:`.Mutable` class. +.. versionchanged:: 0.7 + The internals of :func:`.orm.composite` have been + greatly simplified and in-place mutation detection is no longer enabled by + default; instead, the user-defined value must detect changes on its own and + propagate them to all owning parents. The :mod:`sqlalchemy.ext.mutable` + extension provides the helper class :class:`.MutableComposite`, which is a + slight variant on the :class:`.Mutable` class. As is the case with :class:`.Mutable`, the user-defined composite class subclasses :class:`.MutableComposite` as a mixin, and detects and delivers |
