Skip to content

Commit

Permalink
Lazy load Topic in frontend.views
Browse files Browse the repository at this point in the history
  • Loading branch information
whtsky committed Jul 4, 2014
1 parent 00b8cb9 commit 6c833cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gather/frontend/views.py
@@ -1,19 +1,20 @@
# -*- coding:utf-8 -*-

from flask import Blueprint, render_template, make_response
from gather.topic.models import Topic

bp = Blueprint("frontend", __name__, url_prefix="")


@bp.route("/")
def index():
from gather.topic.models import Topic
topics = Topic.query.order_by(Topic.updated.desc()).limit(5)
return render_template("index.html", topics=topics)


@bp.route("/feed")
def feed():
from gather.topic.models import Topic
topics = Topic.query.order_by(Topic.updated.desc()).limit(15)
response = make_response(render_template("feed.xml", topics=topics))
response.mimetype = "application/atom+xml"
Expand Down

0 comments on commit 6c833cf

Please sign in to comment.