summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLawouach <sh@defuze.org>2015-07-19 21:32:05 +0200
committerLawouach <sh@defuze.org>2015-07-19 21:32:05 +0200
commit0411fd7fe7b724e63f0a440a952235d54212fad3 (patch)
tree320ffc7fe15772069d348981a00c96eb1dbf5b2b
parent2a72821b1da34f43f1b55fd1d8d7d379aee92732 (diff)
downloadcherrypy-0411fd7fe7b724e63f0a440a952235d54212fad3.tar.gz
fetch a row from the result not the connection
-rw-r--r--docs/tutorials.rst4
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)))