From 4975d6f9319ccd65f5d90a24de9dd5394da0d847 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sun, 18 Mar 2012 15:26:38 +0100 Subject: Replace Thread-ID by ThreadID so that we can use it in the templates --- lib/mongo.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/mongo.py') diff --git a/lib/mongo.py b/lib/mongo.py index e429eea..2e971ed 100644 --- a/lib/mongo.py +++ b/lib/mongo.py @@ -56,17 +56,17 @@ def get_thread(table, start, end): def get_thread_length(table, thread_id): db = connection[table] - db.mails.create_index('Thread-ID') - db.mails.ensure_index('Thread-ID') - return db.mails.find({'Thread-ID': thread_id}).count() + db.mails.create_index('ThreadID') + db.mails.ensure_index('ThreadID') + return db.mails.find({'ThreadID': thread_id}).count() def get_thread_participants(table, thread_id): db = connection[table] - db.mails.create_index('Thread-ID') - db.mails.ensure_index('Thread-ID') + db.mails.create_index('ThreadID') + db.mails.ensure_index('ThreadID') authors = set() - for mail in db.mails.find({'Thread-ID': thread_id}): + for mail in db.mails.find({'ThreadID': thread_id}): authors.add(mail['From']) return len(authors) -- cgit