]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix incorrect with_parent() example
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 Jan 2022 14:24:08 +0000 (09:24 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 Jan 2022 14:25:20 +0000 (09:25 -0500)
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

index a282adea4b9967d500c21e5b2b525947e274cc84..262898127ba0449f04a7efb9b78fcbd945236a53 100644 (file)
@@ -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