Fixed sqlite3 pattern. This fixes #924

This commit is contained in:
Armin Ronacher 2014-02-08 22:14:23 +00:00
parent a8a98bc6b6
commit 6f44ca705f

View file

@ -17,7 +17,7 @@ Here is a simple example of how you can use SQLite 3 with Flask::
def get_db(): def get_db():
db = getattr(g, '_database', None) db = getattr(g, '_database', None)
if db is None: if db is None:
db = g._database = connect_to_database() db = g._database = sqlite3.connect(DATABASE)
return db return db
@app.teardown_appcontext @app.teardown_appcontext