From a49376017d473470accda959140409896f7dc879 Mon Sep 17 00:00:00 2001 From: nathaniel smith Date: Sat, 1 Aug 2015 17:19:56 -0700 Subject: [PATCH] reverse a sort --- tildetown-py/cgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tildetown-py/cgi.py b/tildetown-py/cgi.py index d8b7e27..907f1a2 100644 --- a/tildetown-py/cgi.py +++ b/tildetown-py/cgi.py @@ -55,7 +55,7 @@ def get_guestbook(): # TODO sort by timestamp filename_to_json = lambda p: json.loads(slurp(os.path.join(data_dir, p))) posts = map(filename_to_json, os.listdir(data_dir)) - sorted_posts = sorted(posts, key=lambda p: p['timestamp']) + sorted_posts = sorted(posts, key=lambda p: p['timestamp'], reverse=True) context = { "posts": sorted_posts,