Skip to content

Commit

Permalink
Merge pull request bottlepy#375 from nstawski/master
Browse files Browse the repository at this point in the history
Fixed code indent in one of the examples
  • Loading branch information
defnull committed Sep 16, 2012
2 parents 5238c61 + cddc405 commit 2ed157c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/tutorial_app.rst
Expand Up @@ -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::
Expand Down

0 comments on commit 2ed157c

Please sign in to comment.