[sqlalchemy] Re: cascade=all, delete-orphan = FlushError, instance is an unsaved, pending instance and is an orphan

2007-06-28 Thread svilen
On Thursday 28 June 2007 16:16:09 znerol wrote: Hi All Yes, i know, there is a FAQ-entry and i realized that this issue was discussed before. Regretably i'm not able to make things work with a one-to-many relationship using cascade=all, delete-orphan. Now i discovered that even the example

[sqlalchemy] Re: cascade=all, delete-orphan = FlushError, instance is an unsaved, pending instance and is an orphan

2007-06-28 Thread Michael Bayer
On Jun 28, 2007, at 9:16 AM, znerol wrote: Hi All Yes, i know, there is a FAQ-entry and i realized that this issue was discussed before. Regretably i'm not able to make things work with a one-to-many relationship using cascade=all, delete-orphan. Now i discovered that even the example

[sqlalchemy] Re: cascade=all, delete-orphan = FlushError, instance is an unsaved, pending instance and is an orphan

2007-06-28 Thread lorenz schori
Hi Again I was able to track down the issue. If the addresses attribute is replaced with a newly generated list containing all the items from the old list sqlalchemy apparently thinks that the elements are to be deleted (because the list was replaced) and marks them as orphan. Same