summaryrefslogtreecommitdiffstats
path: root/lib/mongo.py
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2012-03-18 15:26:38 +0100
committerPierre-Yves Chibon <pingou@pingoured.fr>2012-03-18 15:26:38 +0100
commit4975d6f9319ccd65f5d90a24de9dd5394da0d847 (patch)
tree80ac57ce35cdf9f155508a924a0602338c69b8ca /lib/mongo.py
parent5b0e4f783a405d1532004a47e6cf4984769ebb5e (diff)
downloadhyperkitty-4975d6f9319ccd65f5d90a24de9dd5394da0d847.tar.gz
hyperkitty-4975d6f9319ccd65f5d90a24de9dd5394da0d847.tar.xz
hyperkitty-4975d6f9319ccd65f5d90a24de9dd5394da0d847.zip
Replace Thread-ID by ThreadID so that we can use it in the templates
Diffstat (limited to 'lib/mongo.py')
-rw-r--r--lib/mongo.py12
1 files changed, 6 insertions, 6 deletions
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)