def delete(self): """Deletes the board. Children must be loaded. """ assert (self.columns) # at least, contains the archive for column in self.columns: column().delete(purge=True) self.data.delete_history() self.data.delete_members() session.refresh(self.data) self.data.delete() return True
def delete(self): """Deletes the board. Children must be loaded. """ assert(self.columns) # at least, contains the archive for column in self.columns: column().delete(purge=True) self.data.delete_history() self.data.delete_members() session.refresh(self.data) self.data.delete() return True
def leave(self, comp=None): """Children must be loaded.""" # FIXME: all member management function should live in another component than Board. user = security.get_user() for member in self.members: m_user = member().user().data if (m_user.username, m_user.source) == (user.data.username, user.data.source): board_member = member() break else: board_member = None self.data.remove_member(board_member) if user.is_manager(self): self.data.remove_manager(board_member) if not self.columns: self.load_children() for column in self.columns: column().remove_board_member(user) if comp: self.emit_event(comp, events.BoardLeft) return True