From: Mike Bayer
Date: Sun, 8 Jan 2006 01:35:56 +0000 (+0000)
Subject: removed 'primarytable' keyword argument
X-Git-Tag: rel_0_1_0~156
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7cb91284f79cc043a352c95e01b0c38acc6ed7e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git
removed 'primarytable' keyword argument
---
diff --git a/doc/build/content/adv_datamapping.myt b/doc/build/content/adv_datamapping.myt
index 1a6cce8337..0dc1a0349f 100644
--- a/doc/build/content/adv_datamapping.myt
+++ b/doc/build/content/adv_datamapping.myt
@@ -227,7 +227,7 @@ WHERE rowcount.user_id = users.user_id ORDER BY users.oid, addresses.oid
<&|formatting.myt:code&>
# join users and addresses
usersaddresses = sql.join(users, addresses, users.c.user_id == addresses.c.user_id)
- m = mapper(User, usersaddresses, primarytable = users,
+ m = mapper(User, usersaddresses,
properties = {
'id' : [users.c.user_id, addresses.c.user_id],
}
@@ -391,7 +391,7 @@ WHERE rowcount.user_id = users.user_id ORDER BY users.oid, addresses.oid
class Customer(object):
pass
- mapper = mapper(Customer, s, primarytable=customers)
+ mapper = mapper(Customer, s)
&>
Above, the "customers" table is joined against the "orders" table to produce a full row for each customer row, the total count of related rows in the "orders" table, and the highest price in the "orders" table, grouped against the full set of columns in the "customers" table. That query is then mapped against the Customer class. New instances of Customer will contain attributes for each column in the "customers" table as well as an "order_count" and "highest_order" attribute. Updates to the Customer object will only be reflected in the "customers" table and not the "orders" table. This is because the primary keys of the "orders" table are not represented in this mapper and therefore the table is not affected by save or delete operations.
&>
@@ -713,4 +713,4 @@ a full round-trip attribute tracking operation is illustrated:
&>
Objects that contain the attribute "_instance_key" are already registered with the Identity Map, and are assumed to have come from the database. They therefore get marked as "dirty" when changes happen. Objects without an "_instance_key" are not from the database, and get marked as "new" when changes happen, although usually this will already have occured via the object's __init__ method.
&>
-&>
\ No newline at end of file
+&>