Tefnet Developers wrote: > > Dnia 2009-10-08, czw o godzinie 09:59 -0400, Michael Bayer pisze: >> > Is this a SQLAlchemy bug or my mistake? >> >> Backrefs deal with the two-way relation between A<->B, but the event >> does >> not propagate in most cases to C or beyond, i.e. A<->B<->C where B is >> attached to A would indicate C->B becomes detached in memory. After a >> commit() all those references would be expired and then you'd see the >> actual connections. >> > > The funny thing is that it works on two separate classes. It behaves > this way when cls.foo = relation(foo ...). What is more, as I have > written in Message-Id: <1255006578.18788.11.ca...@cacko>, > impl.remove(...) is called, but effect is not visible. This seems a bit > inconsistent to me. What do you think?
You'd have to illustrate in code exactly what you're doing. It seems like you're saying that you are accessing the underlying AttributeImpl and firing off events directly, bypassing the public interface. That's all internals - I would only be concerned about "inconsistent" behavior using public APIs. And as far as backrefs not propagating to a third object, its pretty consistent, although interactions among attributes being already loaded/not loaded yet /expired can cause more complexities. There is a full exploration of these issues in http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/test/orm/test_backref_mutations.py . The ultimate cause of the "stopping" of backref propagation has to do with the "initiator" argument passed along events. It is in theory possible to open this system up such that an event keeps propagating endlessly across a chain of relations, though naive openings-up of this system quickly lead to recursion errors, so it would take a serious effort to make it work. But this is a level of complexity that has not been needed . Most people construct their objects, commit them, and they're done. --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---