*django-sizefield* is a file size field, stored as BigInteger and rendered
with units in Bytes (KB, MB, ...)
.. image:: https://github.com/leplatrem/django-sizefield/actions/workflows/tests.yml/badge.svg
:target: https://github.com/leplatrem/django-sizefield/actions/workflows/tests.yml
.. image:: https://coveralls.io/repos/leplatrem/django-sizefield/badge.png
:target: https://coveralls.io/r/leplatrem/django-sizefield
=======
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
=======
* Mathieu Leplatre <contact@mathieu-leplatre.info>
* Alexander (@meteozond)
* Tom Yam (@perez)
=======
LICENSE
=======
* Lesser GNU Public License
=========
CHANGELOG
=========
2.1.0 (2023-06-29)
==================
- Remove usage of removed functions in Django 4 (thanks @hagbarddenstore)
2.0.0 (2020-08-13)
==================
- Dropped support for python 2
- Dropped support for Django <2
- Moved testing to GitHub Actions and tox
1.0.1 (unreleased)
==================
- Nothing changed yet.
1.0.0 (2019-06-21)
==================
- Fix support of Django 1.11/2
0.9.1 (2016-04-13)
==================
- Fix lazy loading of translation infrastructure (#15, thanks @cemiarni).
0.9 (2015-11-12)
================
- Add support for unitless values (#13, thanks @megapctr)
0.8 (2015-10-04)
================
- Add support for Python3 (thanks @naxube)
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/leplatrem/django-sizefield",
"name": "django-sizefield",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "",
"author": "Mathieu Leplatre",
"author_email": "contact@mathieu-leplatre.info",
"download_url": "https://files.pythonhosted.org/packages/e6/f0/c36b08e1f872449075963b370e70d5c4d4ecaf22fbd06c8424965a562d6d/django-sizefield-2.1.0.tar.gz",
"platform": null,
"description": "\n*django-sizefield* is a file size field, stored as BigInteger and rendered\nwith units in Bytes (KB, MB, ...)\n\n.. image:: https://github.com/leplatrem/django-sizefield/actions/workflows/tests.yml/badge.svg\n :target: https://github.com/leplatrem/django-sizefield/actions/workflows/tests.yml\n\n.. image:: https://coveralls.io/repos/leplatrem/django-sizefield/badge.png\n :target: https://coveralls.io/r/leplatrem/django-sizefield\n\n\n=======\nINSTALL\n=======\n\n::\n\n pip install django-sizefield\n\n\n=====\nUSAGE\n=====\n\nModel field\n===========\n\n::\n\n class Data(models.Model):\n path = models.FilePathField()\n size = FileSizeField()\n\n\nThe model form will have a TextInput, which renders the \nvalue with units, and accepts values with or without units.\n\n\nTemplate filter\n===============\n\nIt adds units to any number value:\n\n::\n\n {% load sizefieldtags %}\n \n {{ value|filesize }}\n\n*will render 12.3KB (for example)*\n\n\n=======\nAUTHORS\n=======\n\n * Mathieu Leplatre <contact@mathieu-leplatre.info>\n * Alexander (@meteozond)\n * Tom Yam (@perez)\n\n\n=======\nLICENSE\n=======\n\n * Lesser GNU Public License\n\n\n\n\n\n\n\n=========\nCHANGELOG\n=========\n\n2.1.0 (2023-06-29)\n==================\n\n- Remove usage of removed functions in Django 4 (thanks @hagbarddenstore)\n\n2.0.0 (2020-08-13)\n==================\n\n- Dropped support for python 2\n- Dropped support for Django <2\n- Moved testing to GitHub Actions and tox\n\n1.0.1 (unreleased)\n==================\n\n- Nothing changed yet.\n\n\n1.0.0 (2019-06-21)\n==================\n\n- Fix support of Django 1.11/2\n\n\n0.9.1 (2016-04-13)\n==================\n\n- Fix lazy loading of translation infrastructure (#15, thanks @cemiarni).\n\n\n0.9 (2015-11-12)\n================\n\n- Add support for unitless values (#13, thanks @megapctr)\n\n\n0.8 (2015-10-04)\n================\n\n- Add support for Python3 (thanks @naxube)\n\n\n0.7 (2015-03-13)\n================\n\n- Add Zetta and Yotta support (thanks @meteozond)\n- Fix bug with big values (fixes #8, thanks @meteozond)\n\n\n0.6 (2014-09-25)\n================\n\n- Add Exabytes support (thanks Matt Pritchard)\n\n0.5 (2014-06-18)\n================\n\n- Fix template tag not support None values (fixes #4)\n- Support comma notation for float values (fixes #5)\n\n0.4 (2013-08-25)\n================\n\n- Complete refactor by @perez\n\n0.3 (2013-06-08)\n================\n\n- South support by @meteozond\n\n0.2 (2013-05-31)\n================\n\n- Petabytes support by @meteozond\n\n0.1 (2011-01-04)\n================\n\n- Initial working version.\n",
"bugtrack_url": null,
"license": "LPGL, see LICENSE file.",
"summary": "A model field to store a file size, whose edition and display shows units.",
"version": "2.1.0",
"project_urls": {
"Download": "http://pypi.python.org/pypi/django-sizefield/",
"Homepage": "https://github.com/leplatrem/django-sizefield"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6f0c36b08e1f872449075963b370e70d5c4d4ecaf22fbd06c8424965a562d6d",
"md5": "2c73a4a9da979660a3ec3a8110aad923",
"sha256": "02b119dc72f68466af2c9a3011fdb54b523925409c28de7461d1b3e10c6fa4f0"
},
"downloads": -1,
"filename": "django-sizefield-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "2c73a4a9da979660a3ec3a8110aad923",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 7764,
"upload_time": "2023-06-29T12:00:59",
"upload_time_iso_8601": "2023-06-29T12:00:59.121175Z",
"url": "https://files.pythonhosted.org/packages/e6/f0/c36b08e1f872449075963b370e70d5c4d4ecaf22fbd06c8424965a562d6d/django-sizefield-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-29 12:00:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "leplatrem",
"github_project": "django-sizefield",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "django-sizefield"
}