such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
Unicode
-------
-SQLAlchemy 0.6 uses the "native unicode" mode provided as of cx_oracle 5. cx_oracle 5.0.2
-or greater is recommended for support of NCLOB. If not using cx_oracle 5, the NLS_LANG
-environment variable needs to be set in order for the oracle client library to use
-proper encoding, such as "AMERICAN_AMERICA.UTF8".
+.. versionadded:: 0.6
+ SQLAlchemy 0.6 uses the "native unicode" mode provided as of cx_oracle 5.
+ cx_oracle 5.0.2 or greater is recommended for support of NCLOB.
+ If not using cx_oracle 5, the NLS_LANG environment variable needs to be
+ set in order for the oracle client library to use
+ proper encoding, such as "AMERICAN_AMERICA.UTF8".
Also note that Oracle supports unicode data through the NVARCHAR and NCLOB data types.
When using the SQLAlchemy Unicode and UnicodeText types, these DDL types will be used
Note that this behavior is disabled when Oracle 8 is detected, as it has been
observed that issues remain when passing Python unicodes to cx_oracle with Oracle 8.
+.. versionchanged:: 0.6
+ Use of native unicode mode provided as of cx_oracle 5.
+
LOB Objects
-----------
test to determine the current "decimal" character, which can be
a comma "," for european locales. From that point forward the
outputtypehandler uses that character to represent a decimal
-point (this behavior is new in version 0.6.6). Note that
-cx_oracle 5.0.3 or greater is required when dealing with
-numerics with locale settings that don't use a period "." as the
-decimal character.
+point. Note that cx_oracle 5.0.3 or greater is required
+when dealing with numerics with locale settings that don't use
+a period "." as the decimal character.
+
+.. versionchanged:: 0.6.6
+ The outputtypehandler uses a comma "," character to represent
+ a decimal point.
.. _OCI: http://www.oracle.com/technetwork/database/features/oci/index.html
:param as_tuple=False: Specify whether return results should be converted
to tuples from lists. DBAPIs such as psycopg2 return lists by default.
When tuples are returned, the results are hashable. This flag can only
- be set to ``True`` when ``mutable`` is set to ``False``. (new in 0.6.5)
+ be set to ``True`` when ``mutable`` is set to ``False``.
+
+ .. versionadded:: 0.6.5
"""
if isinstance(item_type, ARRAY):
:meth:`~.ResultProxy.fetchmany`
:meth:`~.ResultProxy.fetchall`.
- New in 0.6.7.
+ .. versionadded:: 0.6.7
"""
return self._metadata is not None
assuming the statement did not include
a user defined "returning" construct.
- New in 0.6.7.
+ .. versionadded:: 0.6.7
"""
return self.context.isinsert
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
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
"""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.
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
+.. versionchanged:: 0.8
+ SQLSoup is now its own project. Documentation
+ and project status are available at:
+ http://pypi.python.org/pypi/sqlsoup and
+ http://readthedocs.org/docs/sqlsoup\ .
+ SQLSoup will no longer be included with SQLAlchemy.
+
Introduction
============
This is the "master" method that can be used to create any
configuration.
- (new in 0.6.6)
+ .. versionadded:: 0.6.6
:param attrname: String attribute name which will be
established as an attribute on this :class:.`.SqlSoup`
def map(self, selectable, base=None, **mapper_args):
"""Map a selectable directly.
- The class and its mapping are not cached and will
- be discarded once dereferenced (as of 0.6.6).
+ .. versionchanged:: 0.6.6
+ The class and its mapping are not cached and will
+ be discarded once dereferenced.
:param selectable: an :func:`.expression.select` construct.
:param base: a Python class which will be used as the
"""Map a selectable directly, wrapping the
selectable in a subquery with labels.
- The class and its mapping are not cached and will
- be discarded once dereferenced (as of 0.6.6).
+ .. versionchanged:: 0.6.6
+ The class and its mapping are not cached and will
+ be discarded once dereferenced.
:param selectable: an :func:`.expression.select` construct.
:param base: a Python class which will be used as the
base=None, **mapper_args):
"""Create an :func:`.expression.join` and map to it.
- The class and its mapping are not cached and will
- be discarded once dereferenced (as of 0.6.6).
+ .. versionchanged:: 0.6.6
+ The class and its mapping are not cached and will
+ be discarded once dereferenced.
:param left: a mapped class or table object.
:param right: a mapped class or table object.
def relationship(argument, secondary=None, **kwargs):
"""Provide a relationship of a primary Mapper to a secondary Mapper.
- .. note::
-
- :func:`relationship` is historically known as
- :func:`relation` prior to version 0.6.
+ .. versionchanged:: 0.6
+ :func:`relationship` is historically known as :func:`relation`.
This corresponds to a parent-child or associative table relationship. The
constructed class is an instance of :class:`RelationshipProperty`.
value in order to perform a flush. This flag is available
for applications that make use of
:func:`.attributes.get_history` which also need to know
- the "previous" value of the attribute. (New in 0.6.6)
+ the "previous" value of the attribute.
+
+ .. versionadded:: 0.6.6
:param backref:
indicates the string name of a property to be placed on the related
)
})
- ``cascade_backrefs`` is new in 0.6.5.
+ .. versionadded:: 0.6.5
:param collection_class:
a class or callable that returns a new list-holding object. will
* ``immediate`` - items should be loaded as the parents are loaded,
using a separate SELECT statement, or identity map fetch for
- simple many-to-one references. (new as of 0.6.5)
+ simple many-to-one references.
+
+ .. versionadded:: 0.6.5
* ``joined`` - items should be loaded "eagerly" in the same query as
that of the parent, using a JOIN or LEFT OUTER JOIN. Whether
aware of the "new" value in order to perform a flush. This
flag is available for applications that make use of
:func:`.attributes.get_history` which also need to know
- the "previous" value of the attribute. (new in 0.6.6)
+ the "previous" value of the attribute.
+
+ .. versionadded:: 0.6.6
:param comparator_factory: a class which extends
:class:`.ColumnProperty.Comparator` which provides custom SQL clause
"""Return a ``MapperOption`` that will convert the property of the given
name into an joined eager load.
- .. note::
-
- This function is known as :func:`eagerload` in all versions
- of SQLAlchemy prior to version 0.6beta3, including the 0.5 and 0.4
- series. :func:`eagerload` will remain available for the foreseeable
- future in order to enable cross-compatibility.
+ .. versionchanged:: 0.6beta3
+ This function is known as :func:`eagerload` in all versions
+ of SQLAlchemy prior to version 0.6beta3, including the 0.5 and 0.4
+ series. :func:`eagerload` will remain available for the foreseeable
+ future in order to enable cross-compatibility.
Used with :meth:`~sqlalchemy.orm.query.Query.options`.
"""Return a ``MapperOption`` that will convert all properties along the
given dot-separated path into an joined eager load.
- .. note::
-
+ .. versionchanged:: 0.6beta3
This function is known as :func:`eagerload_all` in all versions
of SQLAlchemy prior to version 0.6beta3, including the 0.5 and 0.4
series. :func:`eagerload_all` will remain available for the
See also: :func:`lazyload`, :func:`eagerload`, :func:`subqueryload`
- New as of verison 0.6.5.
+ .. versionadded:: 0.6.5
"""
return strategies.EagerLazyOption(keys, lazy='immediate')
return strategies.UndeferGroupOption(name)
from sqlalchemy import util as _sa_util
-_sa_util.importlater.resolve_all()
\ No newline at end of file
+_sa_util.importlater.resolve_all()
instance population will not proceed, giving this extension an
opportunity to populate the instance itself, if desired.
- As of 0.5, most usages of this hook are obsolete. For a
- generic "object has been newly created from a row" hook, use
- ``reconstruct_instance()``, or the ``@orm.reconstructor``
- decorator.
+ .. deprecated:: 0.5
+ As of 0.5, most usages of this hook are obsolete. For a
+ generic "object has been newly created from a row" hook, use
+ ``reconstruct_instance()``, or the ``@orm.reconstructor``
+ decorator.
"""
return EXT_CONTINUE
Analogous to :meth:`sqlalchemy.sql._SelectBaseMixin.label`.
- New in 0.6.5.
+ .. versionadded:: 0.6.5
"""
Analogous to :meth:`sqlalchemy.sql._SelectBaseMixin.as_scalar`.
- New in 0.6.5.
+ .. versionadded:: 0.6.5
"""
q = q.join((subq, subq.c.email < Address.email)).\\
limit(1)
- New in 0.6.5.
+ .. versionadded:: 0.6.5
"""
self._set_entities(entities)
unique entity or entities - this is a successful result for one().
Calling ``one()`` results in an execution of the underlying query.
- As of 0.6, ``one()`` fully fetches all results instead of applying
- any kind of limit, so that the "unique"-ing of entities does not
- conceal multiple object identities.
+
+ .. versionchanged:: 0.6
+ ``one()`` fully fetches all results instead of applying
+ any kind of limit, so that the "unique"-ing of entities does not
+ conceal multiple object identities.
"""
ret = list(self)
instances behind the scenes, with one ``Transaction`` per ``Engine`` in
use.
- Direct usage of ``SessionTransaction`` is not necessary as of SQLAlchemy
- 0.4; use the ``begin()`` and ``commit()`` methods on ``Session`` itself.
+ .. versionchanged:: 0.4
+ Direct usage of ``SessionTransaction`` is not
+ necessary; use the ``begin()`` and ``commit()``
+ methods on ``Session`` itself.
The ``SessionTransaction`` object is **not** thread-safe.
Python without the need to render joins to the parent table
in the rendered statement.
- As of 0.6.4, this method accepts parent instances in all
- persistence states, including transient, persistent, and detached.
- Only the requisite primary key/foreign key attributes need to
- be populated. Previous versions didn't work with transient
- instances.
+ .. versionchanged:: 0.6.4
+ This method accepts parent instances in all
+ persistence states, including transient, persistent, and detached.
+ Only the requisite primary key/foreign key attributes need to
+ be populated. Previous versions didn't work with transient
+ instances.
:param instance:
An instance which has some :func:`.relationship`.
class PassiveDefault(DefaultClause):
"""A DDL-specified DEFAULT column value.
- .. deprecated:: 0.6 :class:`.PassiveDefault` is deprecated.
+ .. deprecated:: 0.6
+ :class:`.PassiveDefault` is deprecated.
Use :class:`.DefaultClause`.
"""
@util.deprecated("0.6",