endorsement/achievements.py

11 lines
270 B
Python
Raw Normal View History

from app import app
from models import Achievement
import json
@app.route("/achievement/<id>")
def get_achievement(id):
achievement = Achievement.query.filter_by(id=id).first()
if not achievement:
return "{}"
return json.dumps(achievement.to_obj())