From d0c8eef61a4a9610ede96f8aaed3666d4b6264c3 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 27 Dec 2013 10:50:11 +0100 Subject: Sort the result of the search. --- pyaggr3g470r/views.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 29965da8..4e8fa6ef 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -288,6 +288,7 @@ def search(): for article_id in results[feed_id]: current_article = models.Article.objects(id=article_id).first() feed.articles.append(current_article) + feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=True) result.append(feed) return render_template('search.html', feeds=result, nb_articles=nb_articles, query=query) -- cgit