示例#1
0
def new_country(book_uuid, country):
    ds = DataStorage()
    if ds.add_country(book_uuid, country):
        ds.save()
    else:
        print("Failed")

    return country
示例#2
0
def delete_recipe(uuid):
    ds = DataStorage()
    res = ds.delete_recipe(uuid)
    ds.save()

    return uuid
示例#3
0
def save_recipe():
    ds = DataStorage()
    new = ds.update(json.loads(request.json))
    ds.save()

    return jsonify({"was_new": new, "recipe": request.json})
示例#4
0
def get_recipe(uuid):
    ds = DataStorage()
    r, country = ds.find_recipe(uuid)
    r["country"] = country["country"]
    return json.dumps(r)
示例#5
0
def index():
    ds = DataStorage()
    all = ds.get_all()
    print(all)
    return render_template("index.html", title="title", all=all)