Esempio n. 1
0
def index():
    meals = Meal.select()
    return jsonify([{
        "id": meal.id,
        "name": meal.name,
        "prep_time": meal.prep_time,
        "cookware": meal.cookware
    } for meal in meals])
Esempio n. 2
0
def new_breakfast():

    food = Meal.select().where(Meal.meal == 'breakfast')
    food_data = []

    for f in food:
        info = {"label": f"{f.food} - {f.calories}kcal", "value": f.food}
        food_data.append(info)

    return jsonify(food_data), 200