aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2015-06-01 09:42:57 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2015-06-01 09:42:57 +0200
commit91f59ed464640e85808320b99d00d66aff452cf0 (patch)
tree3a6f9ac1ad99d926d6f44e28111b863fed5de53d /pyaggr3g470r
parentRun the asyncio loop in a try block. (diff)
downloadnewspipe-91f59ed464640e85808320b99d00d66aff452cf0.tar.gz
newspipe-91f59ed464640e85808320b99d00d66aff452cf0.tar.bz2
newspipe-91f59ed464640e85808320b99d00d66aff452cf0.zip
This sort is supposed to be based on the feed's name.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/views/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py
index 5897bc9e..c9a92852 100644
--- a/pyaggr3g470r/views/views.py
+++ b/pyaggr3g470r/views/views.py
@@ -262,13 +262,14 @@ def render_home(filters=None, head_titles=None,
filters['feed_id'] = feed_id
head_titles.append(feed_contr.get(id=feed_id).title)
- sort_param = {"feed": Article.title.desc(),
+ sort_param = {"feed": Feed.title.desc(),
"date": Article.date.desc(),
- "-feed": Article.title.asc(),
+ "-feed": Feed.title.asc(),
"-date": Article.date.asc(),
}.get(sort_, Article.date.desc())
- articles = arti_contr.read(**filters).order_by(sort_param)
+ articles = arti_contr.read(**filters).join(Article.source). \
+ order_by(sort_param)
if limit != 'all':
limit = int(limit)
articles = articles.limit(limit)
bgstack15