From bcba7eb397f47b1bc10f768278a54c7cb8bc019b Mon Sep 17 00:00:00 2001 From: flowerhack Date: Mon, 3 Nov 2014 12:04:25 -0500 Subject: [PATCH] Tweaked sqlite3 documentation --- docs/patterns/sqlite3.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/patterns/sqlite3.rst b/docs/patterns/sqlite3.rst index fe369a44..9cf5c94b 100644 --- a/docs/patterns/sqlite3.rst +++ b/docs/patterns/sqlite3.rst @@ -26,12 +26,11 @@ Here is a simple example of how you can use SQLite 3 with Flask:: if db is not None: db.close() -All the application needs to do in order to now use the database is have -an active application context (which is always true if there is a request -in flight) or to create an application context itself. At that point the -``get_db`` function can be used to get the current database connection. -Whenever the context is destroyed the database connection will be -terminated. +Now, to use the database, the application must either have an active +application context (which is always true if there is a request in flight) +or create an application context itself. At that point the ``get_db`` +function can be used to get the current database connection. Whenever the +context is destroyed the database connection will be terminated. Note: if you use Flask 0.9 or older you need to use ``flask._app_ctx_stack.top`` instead of ``g`` as the :data:`flask.g`