Commits

Julio Biason committed 8e21dfb

added the main/index view

Comments (0)

Files changed (1)

aweek/main/views.py

+#1/usr/bin/python
+# -*- encoding: utf-8 -*-
+
+from flask import Blueprint
+from flask import render_template
+from flask.views import MethodView
+
+from models import Picks
+
+import logging
+
+main = Blueprint('main',
+                 __name__,
+                 template_folder='../templates/main')
+
+_log = logging.getLogger('aweek.main')
+
+
+class ListView(MethodView):
+    def get(self):
+        objs = Picks.objects.all()  # for now, need to filter
+        return render_template('index.html', objs=objs)
+
+
+main.add_url_rule('/', view_func=ListView.as_view('list'))