diff options
author | Marcel Hellkamp <marc@gsites.de> | 2012-09-16 14:09:08 -0700 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2012-09-16 14:09:08 -0700 |
commit | 2ed157cfff2f895d11cd1470359786bd3de79500 (patch) | |
tree | c9ffe36a227ef844604629af1db026203a421930 | |
parent | 5238c615b3ec198fedebb0fcaad4458e3d68d70f (diff) | |
parent | cddc405a8d04220cd339f8d51fc57bfd4dfabdc4 (diff) | |
download | bottle-2ed157cfff2f895d11cd1470359786bd3de79500.tar.gz |
Merge pull request #375 from nstawski/master
Fixed code indent in one of the examples
-rw-r--r-- | docs/tutorial_app.rst | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/tutorial_app.rst b/docs/tutorial_app.rst index 0a0201d..0b41ee0 100644 --- a/docs/tutorial_app.rst +++ b/docs/tutorial_app.rst @@ -250,21 +250,21 @@ The code needs to be extended to:: @route('/new', method='GET') def new_item(): - if request.GET.get('save','').strip(): + if request.GET.get('save','').strip(): - new = request.GET.get('task', '').strip() - conn = sqlite3.connect('todo.db') - c = conn.cursor() + new = request.GET.get('task', '').strip() + conn = sqlite3.connect('todo.db') + c = conn.cursor() - c.execute("INSERT INTO todo (task,status) VALUES (?,?)", (new,1)) - new_id = c.lastrowid + c.execute("INSERT INTO todo (task,status) VALUES (?,?)", (new,1)) + new_id = c.lastrowid - conn.commit() - c.close() + conn.commit() + c.close() - return '<p>The new task was inserted into the database, the ID is %s</p>' % new_id - else: - return template('new_task.tpl') + return '<p>The new task was inserted into the database, the ID is %s</p>' % new_id + else: + return template('new_task.tpl') ``new_task.tpl`` looks like this:: |