Patchwork [7/9] error-report: sort table by 'Submitted on' column

login
register
mail settings
Submitter Roxana
Date Aug. 22, 2014, 8:49 a.m.
Message ID <3ea7d5fa0c6574a5397ebbe29ebf41e723ebc345.1408696291.git.roxana.ciobanu@intel.com>
Download mbox | patch
Permalink /patch/78813/
State New
Headers show

Comments

Roxana - Aug. 22, 2014, 8:49 a.m.
The information in the table needs to be sorted by
"Submitted on", in inverse chronological order (the most
recent error on top).

[YOCTO #6538]

Signer-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 Post/views.py | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/Post/views.py b/Post/views.py
index f9c6655..1844c87 100644
--- a/Post/views.py
+++ b/Post/views.py
@@ -61,6 +61,7 @@  def search(request, template_name, items = None, page = None, query = None):
     if query == "" or query.isspace():
         query = "all"
     elems = Info().getSearchResult(query.strip())
+    elems.sort(key=lambda r : r.BUILD.DATE, reverse=True)
     no = len(elems)
     if no == 0:
         return render_to_response("error-page.html", {"query" : query}, RequestContext(request))