summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNina Stawski <me@ninastawski.com>2012-09-11 11:45:08 -0700
committerNina Stawski <me@ninastawski.com>2012-09-11 11:45:08 -0700
commitcddc405a8d04220cd339f8d51fc57bfd4dfabdc4 (patch)
treec9ffe36a227ef844604629af1db026203a421930
parent5238c615b3ec198fedebb0fcaad4458e3d68d70f (diff)
downloadbottle-cddc405a8d04220cd339f8d51fc57bfd4dfabdc4.tar.gz
Fixed code indent for one of the examples
-rw-r--r--docs/tutorial_app.rst22
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::