From 9aa6f5ca0b924a27dd6fa81b43b6c5ec22ab707c Mon Sep 17 00:00:00 2001 From: grgr Date: Tue, 27 Sep 2022 23:18:36 +0200 Subject: [PATCH] tutorial 2, adding delete function --- __pycache__/app.cpython-310.pyc | Bin 3064 -> 3231 bytes app.py | 11 ++++++++++- database.db | Bin 16384 -> 16384 bytes templates/index.html | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc index 5fb102b93ed48cf4cef7eac748ac18b41e1e29dc..be02a610d01ff8ef97a749b87f8eb11d852fec72 100644 GIT binary patch delta 153 zcmew%K3|eApO=@50SI_9jFXq}P2`hdyf;z%xJ)WvmOzShickt)FH?$4ifju*Gh>uk z3R5tHrrgFKdR#(Pg8DX@c_mhvDR%lPsX3`7sguvKD+|fFxcaz;xGJ~>`THtlmZatu wPv+*(5od!aDFRwlWC$WmfrO^`WDV{PM$^e_xYZcdCST@OX5(Vyk>g_o09uwOFaQ7m delta 59 zcmbO)`9qv9pO=@50SFeQ87FVyoyaG{cw(aVakdnuU/delete/', methods=('POST',)) +def delete(id): + conn = get_db_connection() + conn.execute('DELETE FROM items WHERE id = ?', (id,)) + conn.commit() + conn.close() + return redirect(url_for('index')) \ No newline at end of file diff --git a/database.db b/database.db index 921ff719d3871f5c12cd819c5c8348b7b6c6a965..51632eebd7a98c80f2322a043a1209950ac88a5f 100644 GIT binary patch delta 201 zcmZo@U~Fh$oFL68K2gS*QG8>5>=i9VdQD7cly)`=< z1E+ByhmnDik*VPO3s`QKCX|K_XBh zQK7sf&6o|O*%4E-F-&tJvhIvj5Hw?DV_-CPEdit +
+
+ +
+
{% endfor %}