aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/feed.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/views/feed.py')
-rw-r--r--pyaggr3g470r/views/feed.py8
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)
bgstack15