From: Mike Bayer Date: Sat, 13 Sep 2025 13:54:38 +0000 (-0400) Subject: remove confusing "with_parent()" from query-enabled properties example X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13f569fd615485c50e07f211e37e45d749ccc40d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git remove confusing "with_parent()" from query-enabled properties example references: #12862 Change-Id: I22ee9fa0c566458a465867e307a77c2eb0ddcdd0 --- diff --git a/doc/build/orm/join_conditions.rst b/doc/build/orm/join_conditions.rst index ed7d06c05f..6c6aba8553 100644 --- a/doc/build/orm/join_conditions.rst +++ b/doc/build/orm/join_conditions.rst @@ -1055,7 +1055,14 @@ conjunction with :class:`_query.Query` as follows: @property def addresses(self): - return object_session(self).query(Address).with_parent(self).filter(...).all() + # query using any kind of filter() criteria + return ( + object_session(self) + .query(Address) + .filter(Address.user_id == self.id) + .filter(...) + .all() + ) In other cases, the descriptor can be built to make use of existing in-Python data. See the section on :ref:`mapper_hybrids` for more general discussion