summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-05-04 15:48:48 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-04 16:01:53 -0400
commit9f6b67a37e820b9a5be54301d08f20161bd20ee8 (patch)
treeabdd6a5e6a9d9bbe1a3440f222c5558f948ddf9e /lib/sqlalchemy/orm/util.py
parentff61aac66aa8e3dde691be78b247205f0f2cc079 (diff)
downloadsqlalchemy-9f6b67a37e820b9a5be54301d08f20161bd20ee8.tar.gz
Consider aliased=True, from_joinpoint as legacy
For a 1.4 / 1.3 merge, rewrite the documentation for Query.join() to indicate calling forms that are now considered legacy, including the use of strings in join(), sending a series of join paths in one call, and using the aliased=True flag. update the elementtree examples as well to use aliased() (they are much simpler to understand this way too) and update other links. Also improve docs for aliased() and some other ORM targets such as PropComparator. Change-Id: I636e3a9130dc5509e51c2cf60a52f38fcadffbc6 References: #4705
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r--lib/sqlalchemy/orm/util.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index 3558a7c5f..8513374a8 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -796,12 +796,13 @@ def aliased(element, alias=None, name=None, flat=False, adapt_on_names=False):
but for convenience can also be a :class:`_expression.FromClause` element
.
- :param alias: Optional selectable unit to map the element to. This should
- normally be a :class:`_expression.Alias` object corresponding to the
- :class:`_schema.Table`
- to which the class is mapped, or to a :func:`_expression.select`
- construct that is compatible with the mapping. By default, a simple
- anonymous alias of the mapped table is generated.
+ :param alias: Optional selectable unit to map the element to. This is
+ usually used to link the object to a subquery, and should be an aliased
+ select construct as one would produce from the
+ :meth:`_query.Query.subquery` method or
+ the :meth:`_expression.Select.subquery` or
+ :meth:`_expression.Select.alias` methods of the :func:`_expression.select`
+ construct.
:param name: optional string name to use for the alias, if not specified
by the ``alias`` parameter. The name, among other things, forms the
@@ -816,8 +817,6 @@ def aliased(element, alias=None, name=None, flat=False, adapt_on_names=False):
rewritten as a JOIN against an aliased SELECT subquery on backends that
don't support this syntax.
- .. versionadded:: 0.9.0
-
.. seealso:: :meth:`_expression.Join.alias`
:param adapt_on_names: if True, more liberal "matching" will be used when