Store Measurements Sanely with django-measurement

Storing measurement data for multiple types of units is quite a frustrating task. Fortunately with django-measurement providing a good wrapper for python-measurement it makes this almost a non-issue. In this video get a quick overview of how to use django-measurement to store that pesky data.
Download HD Version next video: Basics of Webpack

resources

models.py

from django.db import models

from measurement.measures import Volume, Distance, Area, Weight

from django_measurement.models import MeasurementField


class Pack(models.Model):
    name = models.CharField(max_length=100)
    volume = MeasurementField(measurement=Volume)
    sides = MeasurementField(measurement=Distance)
    material_size = MeasurementField(measurement=Area)
    max_weight = MeasurementField(measurement=Weight)
comments powered by Disqus