On 30 April 2011 04:26, Dan McGee <dpmcgee@gmail.com> wrote:
On Fri, Apr 29, 2011 at 7:23 PM, Eric BĂ©langer <snowmaniscool@gmail.com> wrote:
2- The report for large packages should list the sizes in MB instead of bytes. That would make the generic nature of these reports a lot harder, and/or involve me sinking quite a bit of time into making something generic that formats sizes. Deal with it for now. :)
filesizeformat [1] built-in filter to the rescue. However, I'm not sure if it'll mess up the jQuery sort thingy. To run this filter for the package compressed/installed size, the template code [2] might be modified to something like this: {% for attr in column_attrs %} <td> {% if attr == 'compressed_size' or attr == 'installed_size' %} {{ pkg|attribute:attr|filesizeformat }} {% else %} {{ pkg|attribute:attr }} {% endif %} </td> {% endfor %} [1] http://docs.djangoproject.com/en/1.3/ref/templates/builtins/#filesizeformat [2] http://projects.archlinux.org/archweb.git/tree/templates/devel/packages.html...