예제 #1
0
    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
예제 #2
0
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='广播成功')
예제 #3
0
def get_projects():
    projects = Project.get_all()
    return jsonify(projects)