diff MoinMoin/items/__init__.py @ 101:856945a6d936

simplify revision data size handling - just store it into metadata Back when the storage api was implemented, size was implemented as a property. I can't remember why this was done, but I assume it was to do backend-specific optimization to quickly access revision data size without accessing metadata. As we'll have an index for most important metadata and we likely have to open metadata anyway, SIZE is now just a metadata entry like all the others, not specialcased any more. Like the revision data hash, SIZE is also automatically stored into the revision's metadata when committing it. This simplifies the code quite a bit and makes it more generic.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 11 Mar 2011 03:52:14 +0100
parents 29f2e129dd36
children c084c1369078
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Tue Mar 08 19:34:42 2011 +0100
+++ b/MoinMoin/items/__init__.py	Fri Mar 11 03:52:14 2011 +0100
@@ -695,7 +695,7 @@
             mt = wikiutil.MimeType(mimestr=mimestr)
             content_disposition = mt.content_disposition(app.cfg)
             content_type = mt.content_type()
-            content_length = rev.size
+            content_length = rev[SIZE]
             file_to_send = rev
         # TODO: handle content_disposition is not None