[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-19 Thread Tefnet Developers
Dnia 2009-10-08, czw o godzinie 11:16 -0400, Michael Bayer pisze: 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

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-09 Thread Christoph Zwerschke
Michael Bayer schrieb: I had the idea that since a1 appears to be in the collections of both u1 and u2, it would be arbitrary where a1 ended up after the flush completed. But that is likely wrong, in that the flush() is going to look at change events to determine what state changes to

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-09 Thread Michael Bayer
Christoph Zwerschke wrote: Michael Bayer schrieb: I had the idea that since a1 appears to be in the collections of both u1 and u2, it would be arbitrary where a1 ended up after the flush completed. But that is likely wrong, in that the flush() is going to look at change events to

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Christoph Zwerschke
Tefnet Developers schrieb: I am having a problem here - at one point a one-to-many relation attribute is not in sync with a backref one (http://dpaste.com/104225/): I can reproduce this and also like to know whether this is a bug or simply not supported by the default list instrumentation.

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Tefnet Developers
Dnia 2009-10-08, czw o godzinie 13:49 +0200, Christoph Zwerschke pisze: By the way, you don't need to use a meta class in your example; you can simply set manager = sqlalchemy.orm.relation( 'Employee', backref='subordinates', remote_side=Id) I needed it for other stuff so

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Michael Bayer
Tefnet Developers wrote: SteveBallmer = Employee(name = 'Steve Ballmer') CraigMundie = Employee(name = 'Craig Mundie') BillGates = Employee(name = 'Bill Gates') CraigMundie.manager = BillGates SteveBallmer.subordinates = [CraigMundie] print CraigMundie.manager: %s % (CraigMundie.manager)

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Tefnet Developers
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

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Michael Bayer
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

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Michael Bayer
Christoph Zwerschke wrote: @Mike: The test code says in a comment flushing at this point means its anyone's guess. Can you elaborate what is meant by this comment? I had the idea that since a1 appears to be in the collections of both u1 and u2, it would be arbitrary where a1 ended up after

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Michael Bayer
On Oct 8, 2009, at 4:02 PM, Christoph Zwerschke wrote: So this behavior is in fact intended by SQLAlchemy. As Mike explained, this is because propagating events further than the 2 objects directly involved would become too complex, possibly leading to recursion and performance issues. the