aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-10-31 20:58:32 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-10-31 20:58:32 +0100
commit2710670654dd543e5dc732049ebe779ca317ac74 (patch)
tree90f0082065b9700c6ab2313a9c48b0e6d423e262 /pyaggr3g470r/views.py
parentAdded authentication with Flask-Login. (diff)
downloadnewspipe-2710670654dd543e5dc732049ebe779ca317ac74.tar.gz
newspipe-2710670654dd543e5dc732049ebe779ca317ac74.tar.bz2
newspipe-2710670654dd543e5dc732049ebe779ca317ac74.zip
Improved templates: rendering of the list of articles
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 359ae15d..fa406fe9 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -140,10 +140,13 @@ def favorites():
@app.route('/unread/', methods=['GET'])
@login_required
def unread():
- feeds = models.Feed.objects().filter(articles__readed=False)
- unread_articles = models.Article.objects.filter(readed = False)
- print len(feeds)
- return render_template('unread.html', feeds=feeds)
+ feeds = models.Feed.objects()
+ result = []
+ for feed in feeds:
+ feed.articles = [article for article in feed.articles if not article.readed]
+ if len(feed.articles) != 0:
+ result.append(feed)
+ return render_template('unread.html', feeds=result)
@app.route('/management/', methods=['GET'])
@login_required
bgstack15