iurisilvio/bottle-sqlalchemy — Issue #2: fail to use the view decorator with db=None
Author: znetor
Created: 2012-02-24 02:08:50+00:00
State: open

@route('/blog/')
@view('blog')
def blog_index(db=None):
posts = db.query(Post).all()
results = "".join(["

%s

" % post.title for post in posts])
return {'results':results}

.../blog.py", line 7, in blog_index
posts = db.query(Post).all()
AttributeError: 'NoneType' object has no attribute 'query'