Opened 8 years ago

Closed 8 years ago

#2466 closed enhancement (invalid)

[patch] Add a 'filesize' filter to the 'humanize' template tags

Reported by: parlar@… Owned by: adrian
Component: Contrib apps Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


This patch adds a new filter 'filesize', which is meant to take in values from the get_XXX_size method of FileFields.

This will return the filesize in a human-friendly format. For example:

1) 654392 would be returned as "543.39KB"

2) 1926876 would be returned as "1.92MB"

3) 1827381726 would be returned as "1.83GB"

Attachments (1)

filesize.diff (1.2 KB) - added by parlar@… 8 years ago.
[patch] Patch for ticket

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by parlar@…

[patch] Patch for ticket

comment:1 Changed 8 years ago by parlar@…

  • Resolution set to invalid
  • Status changed from new to closed

This already exists as 'filesizeformat'

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.