예제 #1
0
def download_dashboards():
    results = search_table("Dashboards", "title", "description")
    csv = "".join([f"{row[0]}, {row[1]}\n" for row in results])

    return Response(
        csv,
        mimetype="text/csv",
        headers={"Content-disposition": "attachment; filename=dashboards.csv"})
예제 #2
0
def list_recipes():
    recipes = search_table("Recipes", "title")
    description = "This is the recipes page for the Knowledge Base web application."
    return render_template("lists.html",
                           title="Recipes",
                           header="Recipes",
                           description=description,
                           items=recipes)
예제 #3
0
def list_dashboards():
    dashboards = search_table("Dashboards", "title")
    description = "This is the dashboards page for the Knowledge Base web application."
    return render_template("lists.html",
                           title="Dashboards",
                           header="Dashboards",
                           description=description,
                           items=dashboards)
예제 #4
0
def delete_note(note_id):
    delete_record("Notes", note_id)
    notes = search_table("Notes", "title")
    description = "This is the notes page for the Knowledge Base web application."
    return render_template("lists.html",
                           title="Notes",
                           header="Notes",
                           description=description,
                           items=notes)