From: Mike Bayer Date: Thu, 26 Jan 2006 00:23:43 +0000 (+0000) Subject: fix to inheritance example X-Git-Tag: rel_0_1_0~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3bc2296a68d3a0323674075ff1ba480cbb72609;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix to inheritance example --- 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 )