My fault - when I said there was an error check, it was for the case where you 
declare relationships A->B and B->A both with backrefs. Here's the thread from 
about six months ago:

http://groups.google.com/group/sqlalchemy/browse_thread/thread/420b7de79119ad4d/8e8311bfd18d05e2?lnk=gst&q=barry+hart#8e8311bfd18d05e2).

Barry


----- Original Message ----
From: Michael Bayer <[EMAIL PROTECTED]>
To: sqlalchemy@googlegroups.com
Sent: Sunday, May 4, 2008 10:31:10 PM
Subject: [sqlalchemy] Re: Duplication of rows in many-to-many relationship



On May 4, 2008, at 8:59 PM, Barry Hart wrote:

With a backref, both ends of the relationship are aware of each other -- if you 
append object b1 to the collection a.b, then a backref b1.a will be updated 
immediately. If you had two different relationships, you wouldn't see an update 
to b1.a until you reload the object.

It seems like it'd be nice if they worked the same -- perhaps there's a good 
reason it doesn't.

I think 0.4 has an error check for some cases of mutual relationships (A->B, 
B->A). Maybe the check is not in place for M:N relationships?

we dont really have any check of A->B / B->A being present without  a backref.  
the backref is technically not needed for a bidirectional o2m/m2o relationship, 
unless the "post_update" option is being used.  

for the m2m, its explicitly needed since only one side needs to handle the 
association table, and the other side needs to be made aware of that.

we've yet to try working up some "alarms" for this sort of thing....its 
probably not that hard to do so (for every "secondary" table, look it up in a 
registry, see if its mapped, etc).



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to