Re: [sqlalchemy] StaleDataError when deleting through an association_proxy

2011-02-03 Thread Andronikos Nedos
assuming Dtable.data_id references BTable. There's a few ways to go about this. The usual way to alter what gets deleted where in a flush is to use SessionExtension.before_flush() to figure out whatever needs to happen based on the pending state of things, using Session.delete() to

[sqlalchemy] StaleDataError when deleting through an association_proxy

2011-02-01 Thread Andronikos Nedos
Hi all, This is a slightly complicated problem, which I'm not sure how to tackle. I get a StaleDataError: UPDATE statement on table 'D' expected to update 1 row(s); 0 were matched. in the following setup and action sequence: Setup: I have defined an association_proxy - named 'tasks' - from

Re: [sqlalchemy] StaleDataError when deleting through an association_proxy

2011-02-01 Thread Michael Bayer
On Feb 1, 2011, at 1:20 PM, Andronikos Nedos wrote: Hi all, This is a slightly complicated problem, which I'm not sure how to tackle. I get a StaleDataError: UPDATE statement on table 'D' expected to update 1 row(s); 0 were matched. in the following setup and action sequence: