From 91f59ed464640e85808320b99d00d66aff452cf0 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 1 Jun 2015 09:42:57 +0200 Subject: This sort is supposed to be based on the feed's name. --- pyaggr3g470r/views/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pyaggr3g470r/views') 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) -- cgit