Permalink
Browse files

list them all

  • Loading branch information...
kennethreitz committed Nov 23, 2011
1 parent 195b38c commit feb740c0beca8bba50fc260100d63ef982e13128
Showing with 24 additions and 10 deletions.
  1. +3 −10 star/core.py
  2. +21 −0 star/templates/index.html
View
@@ -63,17 +63,10 @@ def rfc_published(self):
@app.route('/')
def list_articles():
- s = ''
- # articles = SavedArticle.query.all()
- articles = SavedArticle.query.order_by(desc(SavedArticle.published)).limit(30).all()
+ # GRAB THEM ALL!
+ articles = SavedArticle.query.order_by(desc(SavedArticle.published)).all()
- for a in articles:
- s += str(a.title) + ' ' + str(a.link)
- s += '<br />'
- print a
-
-
- return s
+ render_template('index.html', articles=articles)
@app.route('/feed.atom')
View
@@ -0,0 +1,21 @@
+<html>
+<head>
+ <title>Winchester Star Articles</title>
+</head>
+<body>
+
+<h1>Winchester Star Articles</h1>
+
+<ul>
+{% for article in articles %}
+ <li>
+ <a href="{{ article.link }}">
+ {{ article.title }}
+ </a>
+ </li>
+{% endfor %}
+
+</ul>
+
+</body>
+</html>

0 comments on commit feb740c

Please sign in to comment.