]> 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:51 +0000 (14:39 -0400)
commita4cdd0bc00a9985f0c775a644f7f004d6d4cab0a
tree86481494937eeda24d75e977cd2f84e6bae14493
parent6eae79ac55ea2b25270758ed72f1a08e7f54980e
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
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/orm/query.py
test/orm/test_froms.py