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 3 and Version 4 of SimpleDelete


Ignore:
Timestamp:
11/14/05 19:40:27 (9 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SimpleDelete

    v3 v4  
    33If you have a reference to the object, simply call object.destroySelf() to remove it from the data base, '''provided it is not a foreign key or has any relationships depending on it.''' 
    44 
    5 If you do not have a reference to the object, simply select to get the record, and dereference it to get the object reference. 
    6  
    7 {{{ 
    8 def remove(self, recordID): 
    9     myRecord = MyObject.selectBy(id=recordID) 
    10     if myRecord.count(): 
    11         myRecord = list(myRecord)[0] 
    12         myRecord.destroySelf() 
    13     else: 
    14         #Could not find record with that id. 
    15 }}} 
     5If you do not have a reference to the object, simply select use the delete class method: 
     6MySQLObject.delete(recordId). 
    167 
    178If there are dependencies, you will have to delete the dependent records first (if at all.)