diff options
author | Lawouach <sh@defuze.org> | 2015-07-19 21:32:05 +0200 |
---|---|---|
committer | Lawouach <sh@defuze.org> | 2015-07-19 21:32:05 +0200 |
commit | 0411fd7fe7b724e63f0a440a952235d54212fad3 (patch) | |
tree | 320ffc7fe15772069d348981a00c96eb1dbf5b2b | |
parent | 2a72821b1da34f43f1b55fd1d8d7d379aee92732 (diff) | |
download | cherrypy-0411fd7fe7b724e63f0a440a952235d54212fad3.tar.gz |
fetch a row from the result not the connection
-rw-r--r-- | docs/tutorials.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorials.rst b/docs/tutorials.rst index 659353c8..4a4e5ad0 100644 --- a/docs/tutorials.rst +++ b/docs/tutorials.rst @@ -784,9 +784,9 @@ So let's simply focus on the application code itself: def GET(self): with sqlite3.connect(DB_STRING) as c: cherrypy.session['ts'] = time.time() - c.execute("SELECT value FROM user_string WHERE session_id=?", + r = c.execute("SELECT value FROM user_string WHERE session_id=?", [cherrypy.session.id]) - return c.fetchone() + return r.fetchone() def POST(self, length=8): some_string = ''.join(random.sample(string.hexdigits, int(length))) |