changeset 799:43f5e5aa061a pytest2

whooshify itemsize
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 29 Aug 2011 15:48:04 +0200
parents 468607d20932
children 73409db95e56
files MoinMoin/apps/admin/views.py
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/admin/views.py	Mon Aug 29 15:44:06 2011 +0200
+++ b/MoinMoin/apps/admin/views.py	Mon Aug 29 15:48:04 2011 +0200
@@ -21,7 +21,7 @@
 from MoinMoin.apps.admin import admin
 from MoinMoin import user
 from MoinMoin.storage.error import NoSuchRevisionError
-from MoinMoin.config import SIZE
+from MoinMoin.config import NAME, SIZE
 from MoinMoin.config import SUPERUSER
 from MoinMoin.security import require_permission
 
@@ -229,15 +229,8 @@
     headings = [_('Size'),
                 _('Item name'),
                ]
-    rows = []
-    for item in flaskg.storage.iteritems():
-        try:
-            rev = item.get_revision(-1)
-        except NoSuchRevisionError:
-            # XXX we currently also get user items, they have no revisions -
-            # but in the end, they should not be readable by the user anyways
-            continue
-        rows.append((rev[SIZE], item.name))
+    rows = [(doc[SIZE], doc[NAME])
+            for doc in flaskg.storage.documents(all_revs=False, wikiname=app.cfg.interwikiname)]
     rows = sorted(rows, reverse=True)
     return render_template('admin/itemsize.html',
                            item_name="+admin/itemsize",