On Thu, May 06, 2010 at 08:46:55PM +0300, Imri Goldberg wrote:
> 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?

   Useful, certainly.

Oleg.
-- 
     Oleg Broytman            http://phd.pp.ru/            p...@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to