]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix to inheritance example
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 26 Jan 2006 00:23:43 +0000 (00:23 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 26 Jan 2006 00:23:43 +0000 (00:23 +0000)
doc/build/content/adv_datamapping.myt

index 11d492eb1f08972d205dda655758ce59639ff7ac..5d2e3ccaab70e94091774b5912a15c27b463a880 100644 (file)
@@ -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
 <P>Above, the join condition is determined via the foreign keys between the users and the addresses table.  To specify the join condition explicitly, use <span class="codeline">inherit_condition</span>:
 <&|formatting.myt:code&>
     AddressUser.mapper = mapper(
+            AddressUser,
             addresses, inherits=User.mapper, 
             inherit_condition=users.c.user_id==addresses.c.user_id
         )