Heya
In the past I've run into problems with cascade actions not happening in
sqlite when using deleteMany. Since then, my code doesn't rely on cascade
actions. (even when not using sqlite).
In the last few days I've started using helper "smart" deleteMany functions
which given a query, call deleteMany on all affected classes.

So for example, if I have a many to many relationship between Foo and Bar,
and the join-table is called FooBar, smart delete many will do something
like:
Foo.deleteMany(foo_query)
FooBar.deleteMany((FooBar.q.foo == Foo.q.id) & foo_query)

I was thinking that this could be generalized to a generic smartDeleteMany
function (or whatever name you choose), which automatically does all the
cascade actions, without specifying it manualy for each class.

What do you think? Is this useful?

Cheers,
Imri

-- 
Imri Goldberg
--------------------------------------
http://plnnr.com/ - automatic trip planning
http://www.algorithm.co.il/blogs/
--------------------------------------
-- insert signature here ----
------------------------------------------------------------------------------
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to