def init(self): if self.source_fit.isInvalid: # Very rare for this to happen, but be prepared for it saveddata_session.delete(self.source_fit) saveddata_session.flush() saveddata_session.refresh(self.victim_fit)
def remove(stuff): removeCachedEntry(type(stuff), stuff.ID) with sd_lock: saveddata_session.delete(stuff) commit()