From: Mike Bayer Date: Thu, 6 Jan 2022 14:24:08 +0000 (-0500) Subject: fix incorrect with_parent() example X-Git-Tag: rel_2_0_0b1~557 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21ee595ba9ef3e7abc8982fac7bf488c904cf9c9;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 --- diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index a282adea4b..262898127b 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -1852,7 +1852,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