skip to navigation
skip to content

Not Logged In

django-sizefield 0.4

A model field to store a file size, whose edition and display shows units.

django-sizefield is a file size field, stored as BigInteger and rendered with units in Bytes (KB, MB, ...)

https://travis-ci.org/makinacorpus/django-sizefield.png https://coveralls.io/repos/makinacorpus/django-sizefield/badge.png

INSTALL

pip install django-sizefield

USAGE

Model field

class Data(models.Model):
    path = models.FilePathField()
    size = FileSizeField()

The model form will have a TextInput, which renders the value with units, and accepts values with or without units.

Template filter

It adds units to any number value:

{% load sizefieldtags %}

{{ value|filesize }}

will render 12.3KB (for example)

AUTHORS

LICENSE

  • Lesser GNU Public License

CHANGELOG

0.4 (2013-08-25)

  • Complete refactor by @perez

0.3 (2013-06-08)

  • South support by @meteozond

0.2 (2013-05-31)

  • Petabytes support by @meteozond

0.1 (2011-01-04)

  • Initial working version.
 
File Type Py Version Uploaded on Size
django-sizefield-0.4.zip (md5) Source 2013-08-25 11KB
  • Downloads (All Versions):
  • 22 downloads in the last day
  • 92 downloads in the last week
  • 445 downloads in the last month