def delete(self): """ delete an iDevice from it's parentNode and forums cache """ if self.isAdded: self.forum.deleteDiscussion(self.discussion) self.forumsCache.deleteForum(self.forum) Idevice.delete(self)
def testDelete(self): parentNode = Node(self.package) idevice0 = Idevice("FirstIdevice", "", "", "", "") idevice0.setParentNode(parentNode) idevice1 = Idevice("SecondIdevice", "", "", "", "") idevice1.setParentNode(parentNode) idevice2 = Idevice("ThirdIdevice", "", "", "", "") idevice2.setParentNode(parentNode) idevice1.delete() if idevice1 in parentNode.idevices: print "delete failed"
def delete(self): """ Clear out any old images when this iDevice is deleted """ self.images = {} Idevice.delete(self)