summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/build/orm/inheritance.rst9
-rw-r--r--doc/build/orm/loading_relationships.rst8
-rw-r--r--lib/sqlalchemy/orm/util.py10
3 files changed, 14 insertions, 13 deletions
diff --git a/doc/build/orm/inheritance.rst b/doc/build/orm/inheritance.rst
index f640973c4..fb4de7df3 100644
--- a/doc/build/orm/inheritance.rst
+++ b/doc/build/orm/inheritance.rst
@@ -500,7 +500,7 @@ can be loaded::
manager_and_engineer = with_polymorphic(
Employee, [Manager, Engineer],
- aliased=True)
+ flat=True)
session.query(Company).\
options(
@@ -508,13 +508,6 @@ can be loaded::
)
)
-.. versionadded:: 0.8
- :func:`.joinedload`, :func:`.subqueryload`, :func:`.contains_eager`
- and related loader options support
- paths that are qualified with
- :func:`~sqlalchemy.orm.interfaces.PropComparator.of_type`, supporting
- single target types as well as :func:`.orm.with_polymorphic` targets.
-
Another option for the above query is to state the two subtypes separately;
the :func:`.joinedload` directive should detect this and create the
above ``with_polymorphic`` construct automatically::
diff --git a/doc/build/orm/loading_relationships.rst b/doc/build/orm/loading_relationships.rst
index 941edce2c..ba5f23aa3 100644
--- a/doc/build/orm/loading_relationships.rst
+++ b/doc/build/orm/loading_relationships.rst
@@ -178,6 +178,14 @@ of a particular attribute, the :func:`.defaultload` method/function may be used:
as well as the ``_all()`` functions will remain available for backwards-
compatibility indefinitely.
+Polymorphic Eager Loading
+-------------------------
+
+Specification of polymorpic options on a per-eager-load basis is supported.
+See the section :ref:`eagerloading_polymorphic_subtypes` for examples
+of the :meth:`.PropComparator.of_type` method in conjunction with the
+:func:`.orm.with_polymorphic` function.
+
Default Loading Strategies
--------------------------
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index f76be0380..afd2f9997 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -692,11 +692,11 @@ def with_polymorphic(base, classes, selectable=False,
versions of MySQL.
:param flat: Boolean, will be passed through to the
- :meth:`.FromClause.alias` call so that aliases of :class:`.Join`
- objects don't include an enclosing SELECT. This can lead to more
- efficient queries in many circumstances. A JOIN against a nested JOIN
- will be rewritten as a JOIN against an aliased SELECT subquery on
- backends that don't support this syntax.
+ :meth:`.FromClause.alias` call so that aliases of :class:`.Join`
+ objects don't include an enclosing SELECT. This can lead to more
+ efficient queries in many circumstances. A JOIN against a nested JOIN
+ will be rewritten as a JOIN against an aliased SELECT subquery on
+ backends that don't support this syntax.
Setting ``flat`` to ``True`` implies the ``aliased`` flag is
also ``True``.