def updateTaskStatus(self, id, status):
     db_session.query(TaskEntity).filter(TaskEntity.id == id).update({'status_id': status})
     db_session.commit()
 def insertOrUpdateTask(self, task):
     db_session.add(task)
     db_session.commit()
     return task.id
 def deleteTask(self, id):
     db_session.query(TaskEntity).filter(TaskEntity.id == id).delete()
     db_session.commit()
     return id
 def getHistory(self):
     db_session.flush()
     db_session.commit()
     return db_session.query(HistoryEntity).all()
 def updateHistory(self, hEvent):
     db_session.add(hEvent)
     db_session.commit()
 def getProjectHistory(self, pid):
     db_session.flush()
     db_session.commit()
     return db_session.query(HistoryEntity).filter(HistoryEntity.pid == pid).all()
 def getUserHistory(self, uid):
     db_session.flush()
     db_session.commit()
     return db_session.query(HistoryEntity).filter(HistoryEntity.uid == uid).all()
 def insertOrUpdateProject(self, project):
     db_session.add(project)
     db_session.commit()
     return project.pid