def remove_card(card_id): db_helpers.run_db("delete from cards where card_id = ?", (card_id,)) return redirect("/people/edit")
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")
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")
def remove_card(card_id): db_helpers.run_db('delete from cards where card_id = ?', (card_id, )) return redirect('/people/edit')
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')
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')