Skip to main content

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


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.3.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file django-sizefield-0.3.tar.gz.

File metadata

File hashes

Hashes for django-sizefield-0.3.tar.gz
Algorithm Hash digest
SHA256 a836cc62c87407419fd4f098314efd3ffa8e5f55930b3f9d3b8c28d57def4825
MD5 fbcb780e4caded42c6d2e08184d2afc1
BLAKE2b-256 aeea259daf0f8a82f342fc2298ae7d0020df91684e7969b1a0244ad2fb0c4f82

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page