summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-10-29 12:10:37 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-10-29 16:23:08 -0400
commit3f3d9750df142d47b27c551b90cf01429e8702ca (patch)
treebab4959154dc3076bc231eb06e43db0d849b4987 /lib/sqlalchemy/orm/util.py
parent5aca98e65f471207439471210a1e232c07f0a3ba (diff)
downloadsqlalchemy-3f3d9750df142d47b27c551b90cf01429e8702ca.tar.gz
warnings: with_polymorphic()
Also clarifies a behavior of None/False for the selectable parameter to with_polymorphic() Fixes: #7262 Change-Id: I58c4004e0af227d3995e9ae2461470440f97f252
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r--lib/sqlalchemy/orm/util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index 67be165f6..0e8449068 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -1359,6 +1359,14 @@ def with_polymorphic(
result in their table being appended directly to the FROM clause
which will usually lead to incorrect results.
+ When left at its default value of ``False``, the polymorphic
+ selectable assigned to the base mapper is used for selecting rows.
+ However, it may also be passed as ``None``, which will bypass the
+ configured polymorphic selectable and instead construct an ad-hoc
+ selectable for the target classes given; for joined table inheritance
+ this will be a join that includes all target mappers and their
+ subclasses.
+
:param polymorphic_on: a column to be used as the "discriminator"
column for the given selectable. If not given, the polymorphic_on
attribute of the base classes' mapper will be used, if any. This