def get_builds(): #gets all builds in DB using .find() method builds = [] for build in Build.find(): builds.append(build.to_json()) #returns data for all builds return json.dumps(builds), 200
def blame(): bad_people = dict() for build in Build.find(): if build.status == 2: if bad_people.get(build.author.name, None) is None: bad_people[build.author.name] = 1 else: bad_people[build.author.name] += 1 return jsonify(bad_people)