From de0f251cb8ff525ab597fa6f450451cbfeb80649 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 2 Jun 2015 08:15:13 +0200 Subject: It is now possible to sort the list of articles on the second column (title of article). --- pyaggr3g470r/templates/home.html | 2 +- pyaggr3g470r/views/views.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html index 3d0e3849..dbb95451 100644 --- a/pyaggr3g470r/templates/home.html +++ b/pyaggr3g470r/templates/home.html @@ -72,7 +72,7 @@ {{ _('Feed') }} - {{ _('Article') }} + {{ _('Article') }} {{ _('Date') }} diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index 58b3e7f0..f064236a 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -264,8 +264,10 @@ def render_home(filters=None, head_titles=None, sort_param = {"feed": Feed.title.desc(), "date": Article.date.desc(), + "article": Article.title.desc(), "-feed": Feed.title.asc(), "-date": Article.date.asc(), + "-article": Article.title.asc() }.get(sort_, Article.date.desc()) articles = arti_contr.read(**filters).join(Article.source). \ -- cgit