From 21ee595ba9ef3e7abc8982fac7bf488c904cf9c9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 6 Jan 2022 09:24:08 -0500 Subject: [PATCH] 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 --- lib/sqlalchemy/orm/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.2