django-sizefield 0.7

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, ...)

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.7 (2015-03-13)

  • Add Zetta and Yotta support (thanks @meteozond)
  • Fix bug with big values (fixes #8, thanks @meteozond)

0.6 (2014-09-25)

  • Add Exabytes support (thanks Matt Pritchard)

0.5 (2014-06-18)

  • Fix template tag not support None values (fixes #4)
  • Support comma notation for float values (fixes #5)

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.
LPGL, see LICENSE file.

Author

Mathieu Leplatre

Pip

django-sizefield==0.7

Classifiers

  • Development Status :: 5 - Production/Stable
  • Environment :: Web Environment
  • Framework :: Django
  • Intended Audience :: Developers
  • Operating System :: OS Independent
  • Programming Language :: Python :: 2.7
  • Natural Language :: English
  • Topic :: Utilities
File Type Python Version Uploaded On Downloads
django-sizefield-0.7.zip Source March 13, 2015 11,845
Version Release Date
0.7 March 13, 2015
0.6 Sept. 25, 2014
0.5 June 18, 2014
0.4 Aug. 25, 2013
0.3 June 8, 2013
0.2 May 31, 2013
0.1 Dec. 20, 2010
Date Package Version Action
Aug. 26, 2015, 12:25 a.m. django-sizefield 0.6 Release Created
Aug. 26, 2015, 12:25 a.m. django-sizefield 0.7 Release Created
Aug. 26, 2015, 12:25 a.m. django-sizefield 0.4 Release Created
Aug. 26, 2015, 12:25 a.m. django-sizefield 0.5 Release Created
Aug. 26, 2015, 12:25 a.m. django-sizefield 0.2 Release Created
Aug. 26, 2015, 12:25 a.m. django-sizefield 0.3 Release Created
Aug. 26, 2015, 12:25 a.m. django-sizefield 0.1 Release Created
Aug. 26, 2015, 12:25 a.m. django-sizefield Package Created