changeset 782:5c60754f8d1a pytest2

save memory by not including content in history list. Fixes #42
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 27 Aug 2011 22:10:27 +0200
parents 33bfaf10d752
children 66c5f8bdfb2b
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Sat Aug 27 21:31:33 2011 +0200
+++ b/MoinMoin/apps/frontend/views.py	Sat Aug 27 22:10:27 2011 +0200
@@ -694,7 +694,9 @@
     query = And([Term("wikiname", app.cfg.interwikiname), Term("name_exact", item_name), ])
     # TODO: due to how getPageContent and the template works, we need to use limit=None -
     # it would be better to use search_page (and an appropriate limit, if needed)
-    history = flaskg.storage.search(query, all_revs=True, sortedby="rev_no", reverse=True, limit=None)
+    docs = flaskg.storage.search(query, all_revs=True, sortedby="rev_no", reverse=True, limit=None)
+    # get rid of the content value to save potentially big amounts of memory:
+    history = [dict((k, v) for k, v in doc.iteritems() if k != 'content') for doc in docs]
     history_page = util.getPageContent(history, offset, results_per_page)
     return render_template('history.html',
                            item_name=item_name, # XXX no item here