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). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
