From c3d0ec7556008a404b9e64fc63b402751d6e0956 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Mon, 5 Mar 2012 18:30:46 +0100 Subject: Case insensitive sorting of collections by dict id. --- mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongodb.py b/mongodb.py index c6f6ee8b..ac107c22 100644 --- a/mongodb.py +++ b/mongodb.py @@ -90,7 +90,7 @@ class Articles(object): cursor = self.db[collection_name].find({"type":0, condition[0]:condition[1]}) if cursor.count() != 0: feeds.append(cursor.next()) - feeds = sorted(feeds, key=itemgetter('feed_title')) + feeds.sort(key = lambda elem: elem['feed_title'].lower()) return feeds def get_articles_from_collection(self, feed_id, condition=None): -- cgit