diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-17 20:49:41 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-17 20:49:41 -0400 |
| commit | 50bea2e0e8d4ffa30e4f94ea21748e7ff57d0c0a (patch) | |
| tree | 051d3582d9252ee4a55d6191592acd0525663c0e /lib | |
| parent | b9c8ee00135587f05c8c8d91d93f66c1ac3dc2b6 (diff) | |
| download | sqlalchemy-50bea2e0e8d4ffa30e4f94ea21748e7ff57d0c0a.tar.gz | |
if anybody complains that they didn't know it was called "relation" in 0.5, why..I'll eat my hat !
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/ext/declarative.py | 7 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/__init__.py | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index c6423e7a0..0f5518045 100644 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -100,8 +100,11 @@ Configuring Relationships ========================= Relationships to other classes are done in the usual way, with the added -feature that the class specified to :func:`~sqlalchemy.orm.relationship()` -may be a string name. The "class registry" associated with ``Base`` +feature that the class specified to :func:`~sqlalchemy.orm.relationship` +may be a string name (note that :func:`~sqlalchemy.orm.relationship` is +only available as of SQLAlchemy 0.6beta2, and in all prior versions is known +as :func:`~sqlalchemy.orm.relation`, +including 0.5 and 0.4). The "class registry" associated with ``Base`` is used at mapper compilation time to resolve the name into the actual class object, which is expected to have been defined once the mapper configuration is used:: diff --git a/lib/sqlalchemy/orm/__init__.py b/lib/sqlalchemy/orm/__init__.py index 26cb071b7..3337287d8 100644 --- a/lib/sqlalchemy/orm/__init__.py +++ b/lib/sqlalchemy/orm/__init__.py @@ -175,7 +175,13 @@ def create_session(bind=None, **kwargs): def relationship(argument, secondary=None, **kwargs): """Provide a relationship of a primary Mapper to a secondary Mapper. - + + .. note:: This function is known as :func:`relation` in all versions + of SQLAlchemy prior to version 0.6beta2, including the 0.5 and 0.4 series. + :func:`~sqlalchemy.orm.relationship()` is only available starting with + SQLAlchemy 0.6beta2. The :func:`relation` name will remain available for + the foreseeable future in order to enable cross-compatibility. + This corresponds to a parent-child or associative table relationship. The constructed class is an instance of :class:`RelationshipProperty`. |
