示例#1
0
 def getAllProjects(self):
     session = create_session()
     projectList = session.query(Project).order_by(Project.id).all()
     session.close()
     return projectList
示例#2
0
 def getProjectById(self, id):
     session = create_session()
     project = session.query(Project).filter(Project.id == id).one()
     session.close()
     return project
示例#3
0
 def addProject(self, project):
     session = create_session()
     session.add(project)
     session.commit()
     session.close()
示例#4
0
 def addUser(self, user):
     session = create_session()
     session.add(user)
     session.commit()
     session.close()
示例#5
0
 def getAllUsers(self):
     session = create_session()
     userList = session.query(User).order_by(Task.username).all()
     session.close()
     return userList
示例#6
0
 def getUserById(self, id):
     session = create_session()
     user = session.query(User).filter(User.id == id).one()
     session.close()
     return user
示例#7
0
 def getAllTasks(self):
     session = create_session()
     taskList = session.query(Task).order_by(Task.id).all()
     session.close()
     return taskList
示例#8
0
 def addTask(self, task):
     session = create_session()
     session.add(task)
     session.commit()
     session.close()
示例#9
0
 def getTaskById(self, id):
     session = create_session()
     task = session.query(Task).filter(Task.id == id).one()
     session.close()
     return task
示例#10
0
 def getTasksByProjectId(self, projectId):
     session = create_session()
     taskList = session.query(Task).filter(
         Task.project_id == projectId).all()
     session.close()
     return taskList