From: Mike Bayer Date: Thu, 6 Jan 2022 14:24:08 +0000 (-0500) Subject: fix incorrect with_parent() example X-Git-Tag: rel_1_4_30~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f96e24013c80d933cb8171061be3d316215fe585;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix incorrect with_parent() example The lead example for the with_parent() function docstring was backwards, based on the standard User/Address mapping used in the documentation. Fixes: #7540 Change-Id: Iaff7dc6fdd0c323509231ae5f3122ed76a420915 (cherry picked from commit 21ee595ba9ef3e7abc8982fac7bf488c904cf9c9) --- diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index fba483f890..ae190ec1c1 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -1837,7 +1837,7 @@ def with_parent(instance, prop, from_entity=None): E.g.:: - stmt = select(Address).where(with_parent(some_user, Address.user)) + stmt = select(Address).where(with_parent(some_user, User.addresses)) The SQL rendered is the same as that rendered when a lazy loader