diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-03-23 19:21:30 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-03-23 19:21:30 +0100 |
commit | c94a05150f22d0fef073efdd1ef6f1debb51dbab (patch) | |
tree | 2954b5ab40eabc80d4be29d95814b9809c33b5fb /pyaggr3g470r/views/feed.py | |
parent | Format the date with the adequat Babel filter. (diff) | |
download | newspipe-c94a05150f22d0fef073efdd1ef6f1debb51dbab.tar.gz newspipe-c94a05150f22d0fef073efdd1ef6f1debb51dbab.tar.bz2 newspipe-c94a05150f22d0fef073efdd1ef6f1debb51dbab.zip |
Fixed a minor bug in the '/feed' page.
Diffstat (limited to 'pyaggr3g470r/views/feed.py')
-rw-r--r-- | pyaggr3g470r/views/feed.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py index 2e39ee4b..4fe4e5da 100644 --- a/pyaggr3g470r/views/feed.py +++ b/pyaggr3g470r/views/feed.py @@ -3,6 +3,7 @@ from datetime import datetime from flask import Blueprint, g, render_template +from sqlalchemy import desc from pyaggr3g470r import controllers, utils from pyaggr3g470r.decorators import pyagg_default_decorator, \ @@ -25,9 +26,9 @@ def feed(feed_id=None): "Presents detailed information about a feed." feed = controllers.FeedController(g.user.id).get(id=feed_id) word_size = 6 - articles = controllers.ArticleController(g.user.id)\ - .read(feed_id=feed_id).all() - nb_articles = controllers.ArticleController(g.user.id).read().count() + articles = controllers.ArticleController(g.user.id) \ + .read(feed_id=feed_id) \ + .order_by(desc("Article.date")).all() top_words = utils.top_words(articles, n=50, size=int(word_size)) tag_cloud = utils.tag_cloud(top_words) @@ -49,5 +50,4 @@ def feed(feed_id=None): feed=feed, tag_cloud=tag_cloud, first_post_date=first_article, end_post_date=last_article, - nb_articles=nb_articles, average=average, delta=delta, elapsed=elapsed) |