Skip to content
Myr

Updated examples

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 115d31d · Browse files · 2 files+4 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−6 removed

  • other:+4 added−6 removed

2 files+4 added−6 removed

modified:examples/flaskr/flaskr.py+2 added-3 removed
45 unmodified lines
46 """Make sure we are connected to the database each request."""47 g.db = connect_db()484950@app.after_request51def after_request(response):50@app.teardown_request51def teardown_request(exception):52 """Closes the database again at the end of the request."""53 g.db.close()54 return response545556@app.route('/')57def show_entries():
40 unmodified lines
modified:examples/minitwit/minitwit.py+2 added-3 removed
80 unmodified lines
81 g.user = query_db('select * from user where user_id = ?',82 [session['user_id']], one=True)838485@app.after_request86def after_request(response):85@app.teardown_request86def teardown_request(exception):87 """Closes the database again at the end of the request."""88 g.db.close()89 return response899091@app.route('/')92def timeline():
155 unmodified lines