def next(): try: unsolved = Drill.get(Drill.user == g.user, Drill.solved == False) unsolved.solved = True unsolved.save() except peewee.DoesNotExist, e: pass
def solve(id): print request.form attempt = request.form.get("solution") drill = Drill.get(Drill.id == id) drill.solution = attempt drill.save() success = drill.compare() return json.dumps({"result": success})