Skip to main content

Django Field to help metrics handling

Project description

This project aims to add helpers for FloatField with:

  • Specify unit (meters, feet, bytes) as field’s metadata
  • Specify a number of decimal (without DecimalField)
  • Add get_FIELD_display method on model


from django.db import models
from pony_unitfield.fields import UnitField

class MyModel(models.Model):
    default = UnitField(unit='foo', null=True)

    no_decimal = UnitField(unit='bar', decimal=0, null=True)
    one_decimal = UnitField(unit='ham', decimal=1, null=True)

    non_spaced = UnitField(unit='bone', spaced_display=False, null=True)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pony-unitfield, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size pony-unitfield-0.2.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page