django-pint
django-pint copied to clipboard
pint context
Is there a(lready) way to use the QuanityField with a pint context?
An example of what I would like to do (note the units for force [Newtons] and weight [kilogram] occuring together which makes sense on earth):
class Model(models.model):
with ureg.context('earth'):
field = QuantityField(base_unit='N', default = ureg.Quantity(1,'kg'), unit_choices=['kN', 'ton'])