]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow aliased() to be passed to Query.select_entity_from().
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Mar 2017 17:48:40 +0000 (13:48 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Mar 2017 18:39:29 +0000 (14:39 -0400)
commit6bdfeb73f2ebb8cf4817550e749c2f7103961d0e
treece4d0cb472ef09ca121404b281a73ffd2131d22b
parentc531deda1042fec53435aa3fdc3dc4395de5199d
Allow aliased() to be passed to Query.select_entity_from().

An :func:`.aliased()` construct can now be passed to the
:meth:`.Query.select_entity_from` method.   Entities will be pulled
from the selectable represented by the :func:`.aliased` construct.
This allows special options for :func:`.aliased` such as
:paramref:`.aliased.adapt_on_names` to be used in conjunction with
:meth:`.Query.select_entity_from`.

Additionally rewrote the docstring for :meth:`.Query.select_entity_from`,
including starting with explicit use of :func:`.aliased` as the
usual idiomatic pattern.  An example using text().columns() is added
as well as the use case from :ticket:`3933` using name matching.

Change-Id: If7e182965236993064a2a086e3b6d55a4f097ca8
Fixes: #3933
(cherry picked from commit b5577b6fb3decda0293399a630e6601e86e08726)
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/orm/query.py
test/orm/test_froms.py