[sqlalchemy] Cascading delete in reverse fashion

2013-04-15 Thread Serge S. Koval
Hi, I have two models: Parent and Child. Whenever Parent is deleted, children will be cleaned up with help of cascade rules. However, I would also like to delete parent if there are no children left. Right now, I'm thinking about ON DELETE trigger on Child table, running query to calculate

[sqlalchemy] Cascading delete down through in directed graph

2010-07-24 Thread troutwine
Hello all, I've made some modifications to the directed graph[1] example, of primary interest to this email being the introduction Manufacturer objects which act as owners of Nodes. My desire is to cascade the deletion of a Manufacturer down to every Node and Edge, even if the side of one Edge is

[sqlalchemy] Cascading delete

2008-08-21 Thread Bob Farrell
Hi there, I spoke with zzzeek_ on IRC yesterday re: some code I'd written for an introspective cascading delete function. We were previously using the ORM to do this for us but, due to the way it works, it was taking several minutes to delete large amounts of second-generation orphans. The code