def get(self): session = main_db.session response = {"list": [], "code": ""} result = Project.get_all(session, None) for project in result: response["list"].append(project.as_dict()) return response, 200
def progress(): projects = Project.get_all() projects_list = [] for project in projects: p = { 'id': project.id, 'name': project.name, 'progress': project.progress, 'running': project.running, } projects_list.append(p) socket_io.emit('progress', projects_list) del projects return Success(msg='广播成功')
def get_projects(): projects = Project.get_all() return jsonify(projects)