示例#1
0
def remove_card(card_id):
    db_helpers.run_db("delete from cards where card_id = ?", (card_id,))
    return redirect("/people/edit")
示例#2
0
def remove_person(user_id):
    db_helpers.run_db("delete from cards where user_id = ?", (user_id,))
    db_helpers.run_db("delete from users where user_id = ?", (user_id,))
    return redirect("/people/edit")
示例#3
0
def add_person():
    name = request.form.get("name")
    img = sqlite3.Binary(request.files.get("img").read())
    db_helpers.run_db("insert into users(name, image) values(?,?)", (name, img))
    return redirect("/people/edit")
示例#4
0
def remove_card(card_id):
    db_helpers.run_db('delete from cards where card_id = ?', (card_id, ))
    return redirect('/people/edit')
示例#5
0
def remove_person(user_id):
    db_helpers.run_db('delete from cards where user_id = ?', (user_id, ))
    db_helpers.run_db('delete from users where user_id = ?', (user_id, ))
    return redirect('/people/edit')
示例#6
0
def add_person():
    name = request.form.get('name')
    img = sqlite3.Binary(request.files.get('img').read())
    db_helpers.run_db('insert into users(name, image) values(?,?)',
                      (name, img))
    return redirect('/people/edit')