aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/feed.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-04-06 10:37:13 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-04-06 10:37:13 +0200
commit29bb2a36f0b5d1781ab05f1976aa0c5017351807 (patch)
tree52b2dd87f4d36f6a9c518cc14f96e523b1dea045 /pyaggr3g470r/views/feed.py
parentmisc update (diff)
parentMinor changes to the CSS. (diff)
downloadnewspipe-29bb2a36f0b5d1781ab05f1976aa0c5017351807.tar.gz
newspipe-29bb2a36f0b5d1781ab05f1976aa0c5017351807.tar.bz2
newspipe-29bb2a36f0b5d1781ab05f1976aa0c5017351807.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: pyaggr3g470r/controllers/feed.py pyaggr3g470r/templates/home.html
Diffstat (limited to 'pyaggr3g470r/views/feed.py')
-rw-r--r--pyaggr3g470r/views/feed.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py
index 2af502a7..4fe4e5da 100644
--- a/pyaggr3g470r/views/feed.py
+++ b/pyaggr3g470r/views/feed.py
@@ -1,5 +1,9 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -
+
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, \
@@ -22,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)
@@ -46,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