Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 11 and Version 12 of SimpleDelete


Ignore:
Timestamp:
03/05/06 23:30:26 (13 years ago)
Author:
godoy
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SimpleDelete

    v11 v12  
    4545 
    4646I have a User and he has Items, I want to delete the User with his Items. Right now I go around and loop on the user.items and .destroySelf them, but that's inefficient SQL. I could just do "DELETE FROM item WHERE item.userID = x". Is there anyway to achieve it with SQLObject? 
     47 
     48------ 
     49 
     50Using the SQL cascade feature is the way to go.  This way, you delete the user and everything that allows cascading will also be deleted.  You'll still get an error for tables that have records referencing said user and that doesn't allow cascading (then, when the transaction is rolled back, everything will still be there...).  
     51 
     52By the way, it is better to ask questions on the mailing list since it is hard to find and answer questions here. 
     53 
     54''- Jorge Godoy''