From e3bc2296a68d3a0323674075ff1ba480cbb72609 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 26 Jan 2006 00:23:43 +0000 Subject: [PATCH] fix to inheritance example --- doc/build/content/adv_datamapping.myt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/build/content/adv_datamapping.myt b/doc/build/content/adv_datamapping.myt index 11d492eb1f..5d2e3ccaab 100644 --- a/doc/build/content/adv_datamapping.myt +++ b/doc/build/content/adv_datamapping.myt @@ -335,6 +335,7 @@ WHERE rowcount.user_id = users.user_id ORDER BY users.oid, addresses.oid # define a mapper for AddressUser that inherits the User.mapper, and joins on the user_id column AddressUser.mapper = mapper( + AddressUser, addresses, inherits=User.mapper ) @@ -343,6 +344,7 @@ WHERE rowcount.user_id = users.user_id ORDER BY users.oid, addresses.oid

Above, the join condition is determined via the foreign keys between the users and the addresses table. To specify the join condition explicitly, use inherit_condition: <&|formatting.myt:code&> AddressUser.mapper = mapper( + AddressUser, addresses, inherits=User.mapper, inherit_condition=users.c.user_id==addresses.c.user_id ) -- 2.47.2