aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-23 18:08:44 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-23 18:08:44 +0200
commit8f008278e0eb4f0c523ba301e13d4b03113927dc (patch)
tree6f434968267283d5f4ce2f730b2e2982c82787b5 /pyaggr3g470r/views.py
parentReduce space between items of lists. (diff)
downloadnewspipe-8f008278e0eb4f0c523ba301e13d4b03113927dc.tar.gz
newspipe-8f008278e0eb4f0c523ba301e13d4b03113927dc.tar.bz2
newspipe-8f008278e0eb4f0c523ba301e13d4b03113927dc.zip
Feeds with unread articles are displayed before.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index ec3fcf35..ed8d5fdd 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -215,13 +215,13 @@ def home():
user = User.query.filter(User.email == g.user.email).first()
result, unread = [], {}
for feed in user.feeds:
- unread[feed.id] = Article.query.filter(Article.user_id == g.user.id, Article.feed_id == feed.id, Article.readed == False).count()
new_feed = Feed()
new_feed.id = feed.id
new_feed.title = feed.title
new_feed.enabled = feed.enabled
new_feed.articles = Article.query.filter(Article.user_id == g.user.id,
Article.feed_id == feed.id).order_by(desc("Article.date")).limit(9)
+ new_feed.nb_unread = Article.query.filter(Article.user_id == g.user.id, Article.feed_id == feed.id, Article.readed == False).count()
result.append(new_feed)
unread_articles = len(Article.query.filter(Article.user_id == g.user.id, Article.readed == False).all())
return render_template('home.html', result=result, unread=unread, head_title=unread_articles)
bgstack15