I generally dont have a lot of test cases for objectstore.commit(x), since Im not as confident in its ability to always find what its supposed to be acting upon, and it relies upon the user to give it something sane; i.e. if you had an object C that had a reference to A, which A doesnt know about, then you set C.a to None, objectstore.delete(A) and commit(A), you get an error on that as well since you didnt give it C to commit...and i cant readily fix that one. but a "private" relation is more clear cut, so for your thing below, I added some extra "delete" steps in the dependency traversal which catch your condition below as well as the opposite condition, if you had "B" with a many-to-one "A" attribute which was marked as private, and you deleted "B" and committed "B" alone. You can try this change out in SVN rev 1186. also consider UOW transactions for this kind of thing which also would have worked around this issue prior to this change: trans = objectstore.begin() objectstore.delete(a) trans.commit() On Mar 22, 2006, at 3:27 PM, Aaron Bickell wrote:
|
- [Sqlalchemy-users] objectstore.delete(obj), foreign key exce... Aaron Bickell
- Re: [Sqlalchemy-users] objectstore.delete(obj), foreign... Michael Bayer

