(self)
Delete project from database, update UI
Delete project from database, update UI
Delete project from database update UI
def del_project(self):
        """
        Delete project from database, update UI
        """

        model_index = self.listProjects.currentIndex()
        project_id = model_index.data(QtCore.Qt.UserRole + 1)
        project_name = model_index.data(QtCore.Qt.UserRole + 2)

        # Notify user about deletion
        warn = Warnings(project_name)
        if warn.exec_():
            # Remove project from DB
            self.model_projects.layoutAboutToBeChanged.emit()
            self.eve_data.del_project(project_id)
            self.model_projects.layoutChanged.emit()
def del_project ( self ) : model_index = self . listProjects . currentIndex ( ) project_id = model_index . data ( QtCore . Qt . UserRole + 1 ) project_name = model_index . data ( QtCore . Qt . UserRole + 2 ) # Notify user about deletion warn = Warnings ( project_name ) if warn . exec_ ( ) : # Remove project from DB self . model_projects . layoutAboutToBeChanged . emit ( ) self . eve_data . del_project ( project_id ) self . model_projects . layoutChanged . emit ( )