Skip to content
Permalink
d2206df584
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
20 lines (13 sloc) 465 Bytes
from __future__ import absolute_import, unicode_literals
from guestbook_demo import db
from flask import Flask, render_template
app = Flask('guestbook_demo')
@app.teardown_request
def shutdown_session(exception=None):
db.session.remove()
@app.route("/")
def root():
# TODO paginate me!
entries = db.session.query(db.GuestbookEntry) \
.order_by(db.GuestbookEntry.timestamp.desc())
return render_template('index.html', entries=entries)