changeset 410:0f9a97f74a8d

Fixed https://bitbucket.org/marchael/moin-2.0/issue/3/dicts-are-bad-for-sorting Fixes #3.
author Michael Mayorov <marchael@kb.csu.ru>
date Sun, 07 Aug 2011 17:57:18 +0000
parents 598b1731069b
children 6f6a29825a1e
files MoinMoin/storage/backends/indexing.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/backends/indexing.py	Sun Aug 07 00:36:13 2011 +0200
+++ b/MoinMoin/storage/backends/indexing.py	Sun Aug 07 17:57:18 2011 +0000
@@ -306,7 +306,8 @@
                                                   )
             else:
                 docs = all_revs_searcher.documents(wikiname=self.wikiname)
-            for doc in sorted(docs, reverse=reverse)[start:end]:
+            from operator import itemgetter
+            for doc in sorted(docs, key=itemgetter("mtime", "rev_no"), reverse=reverse)[start:end]:
                 yield (doc[MTIME], mountpoint + doc[NAME], doc["rev_no"])
 
     def all_tags(self):