A model field to store a file size, whose edition and display shows units.
Project description
django-sizefield
A file size field, stored as BigInteger and rendered with units in Bytes (KB, MB, …)
Examples
With a model like
class Data(models.Model): path = models.FilePathField() size = FileSizeField()
In templates
{% load sizefieldtags %} {{ data.size|filesize }}
will render 12.3KB (for example)
The model form will have a TextInput, which renders the value with units, and accepts values with or without units.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-sizefield-0.2.tar.gz
(3.3 kB
view details)
File details
Details for the file django-sizefield-0.2.tar.gz
.
File metadata
- Download URL: django-sizefield-0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ea683d615fc6418700cd1c71310bd0efbfd8911bf87a00c0f037eccb3307d41 |
|
MD5 | ec8926466bdf28407a3f17ddac0a7f4d |
|
BLAKE2b-256 | fcbb7c59f1834d57795b3ebe1044f8a577c08966491a1a1404e7fb9b82d67679 |