A model field to store a file size, whose edition and display shows units (KB, MB, ...)
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.1.tar.gz
(3.0 kB
view details)
File details
Details for the file django-sizefield-0.1.tar.gz
.
File metadata
- Download URL: django-sizefield-0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 813798d2188b3212b3b187fac904b34b188f521e6fb2701e50baac4779451ea2 |
|
MD5 | a230e87b2273c2d1b4c24ea1c78f03a5 |
|
BLAKE2b-256 | 7e0bce4e36e71b84bca8f21f540b5c9a55a7ccf0a8de89ecf99f470dafd7e79b |