From 159ae3dc26248fa0c65f1990b11363c2cc009f54 Mon Sep 17 00:00:00 2001 From: Bill Mill Date: Wed, 31 Jul 2013 22:06:15 -0400 Subject: [PATCH] Fix doc bug, clarify use of make_dicts --- docs/patterns/sqlite3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/patterns/sqlite3.rst b/docs/patterns/sqlite3.rst index f2e7eef3..660b1a0e 100644 --- a/docs/patterns/sqlite3.rst +++ b/docs/patterns/sqlite3.rst @@ -72,10 +72,10 @@ Now in each request handling function you can access `g.db` to get the current open database connection. To simplify working with SQLite, a row factory function is useful. It is executed for every result returned from the database to convert the result. For instance in order to get -dictionaries instead of tuples this can be used:: +dictionaries instead of tuples this could be inserted into ``get_db``:: def make_dicts(cursor, row): - return dict((cur.description[idx][0], value) + return dict((cursor.description[idx][0], value) for idx, value in enumerate(row)) db.row_factory = make_dicts