Skip to content

Why not provide a model field per measure type? #9

@carljm

Description

@carljm

It seems that the design of django-measurement is to provide a single model field, MeasurementField, which is used for all measure types (distance, weight, volume, etc). This requires the MeasurementField to add a third database column to the model's table (in addition to unit and value) to store the name of the measure type.

I suppose this flexibility (to store a different measure type in the same measurement field in different rows) could be useful in some unusual cases, but it seems to me that in most common use cases this flexibility is actually a negative, as I'd prefer to ensure that, for instance, only Distance can be stored in a height field, and in these common cases the additional database column is useless dead weight.

Would you accept a pull request to support measure-specific model fields (e.g. WeightField, DistanceField, VolumeField, etc), which would require only two database columns instead of three?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions