diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-06-15 22:39:45 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-06-15 22:39:45 +0000 |
| commit | adde312c2a774495d68819765cd07372e384efb6 (patch) | |
| tree | 9ca124853a71d39cae23656632067472959d12b5 /doc | |
| parent | a7d0ed81bd77c3721ef2afba8774c50fd34ec78f (diff) | |
| download | sqlalchemy-adde312c2a774495d68819765cd07372e384efb6.tar.gz | |
assoc proxy object appends to list automatically [ticket:1351]
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/reference/ext/associationproxy.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/build/reference/ext/associationproxy.rst b/doc/build/reference/ext/associationproxy.rst index 37cee2179..87489a9e8 100644 --- a/doc/build/reference/ext/associationproxy.rst +++ b/doc/build/reference/ext/associationproxy.rst @@ -177,10 +177,12 @@ relation. user = User('log') kw1 = Keyword('new_from_blammo') - # Adding a Keyword requires creating a UserKeyword association object - user.user_keywords.append(UserKeyword(user, kw1)) + # Creating a UserKeyword association object will add a Keyword. + # the "user" reference assignment in the UserKeyword() constructor + # populates "user_keywords" via backref. + UserKeyword(user, kw1) - # And accessing Keywords requires traversing UserKeywords + # Accessing Keywords requires traversing UserKeywords print user.user_keywords[0] # <__main__.UserKeyword object at 0xb79bbbec> |
