From 2cc79b42a63af4547ed50075403c203a5c790fe1 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Thu, 20 Jan 2011 10:08:20 -0600 Subject: [PATCH] add a top karma givers report --- modules/Karma.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/Karma.py b/modules/Karma.py index 07a85c7..1954c78 100644 --- a/modules/Karma.py +++ b/modules/Karma.py @@ -160,6 +160,9 @@ class Karma(Module): elif (report == 'negative'): query = 'SELECT who, neg FROM karma_users ORDER BY neg DESC LIMIT 5' header = 'Top 5 Pessimists:' + elif (report == 'top'): + query = 'SELECT who, pos+neg AS total FROM karma_users ORDER BY total DESC LIMIT 5' + header = 'Top 5 Total Karma Givers:' if (query != None): conn = self.get_db()