summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-13 17:32:13 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-13 17:32:13 +0000
commitc081749aa65d148fea40adc940fa7ebbfb892224 (patch)
treee7cba94266cd8e2c7d1bca7d0759c38a46778702 /doc
parentc5bc99b8cb3e9e2f238a0c2374470fd9af595295 (diff)
downloadsqlalchemy-c081749aa65d148fea40adc940fa7ebbfb892224.tar.gz
more notes, docsrel_0_1_4
Diffstat (limited to 'doc')
-rw-r--r--doc/build/content/datamapping.myt9
1 files changed, 2 insertions, 7 deletions
diff --git a/doc/build/content/datamapping.myt b/doc/build/content/datamapping.myt
index 35493247c..febf9bf8b 100644
--- a/doc/build/content/datamapping.myt
+++ b/doc/build/content/datamapping.myt
@@ -343,19 +343,14 @@ DELETE FROM addresses WHERE addresses.address_id = :address_id
True
</&>
-+<p>The backreference feature also works with many-to-many relationships, which are described later. When creating a backreference, a corresponding property is placed on the child mapper. This property can be overridden with a custom property using the <span class="codeline">add_property</span> function:
++<p>The backreference feature also works with many-to-many relationships, which are described later. When creating a backreference, a corresponding property is placed on the child mapper. The default arguments to this property can be overridden using the <span class="codeline">backref()</span> function:
<&|formatting.myt:code&>
Address.mapper = mapper(Address, addresses)
User.mapper = mapper(User, users, properties = {
- 'addresses' : relation(Address.mapper, backref='user')
+ 'addresses' : relation(Address.mapper, backref=backref('user', lazy=False, private=True))
}
)
-
- Address.mapper.add_property('user', relation(
- User.mapper, lazy=False, private=True, backref='addresses'
- ))
-
</&>
<p>Note that when overriding a backreferenced property, we re-specify the backreference as well. This will not override the existing 'addresses' property on the User class, but just sends a message to the attribute-management system that it should continue to maintain this backreference.</p>
</&>