Wednesday, April 3, 2019

Difference between DurationField and TimeField

Should we deprecate lino.core.fields.DurationField and recommend using a TimeField instead? No. A DurationField is to store a number of hours (and minutes) while a time field contains the time part of a timestamp. A duration can be more than 24 hours, or it can be negative. I updated the documentation about the lino.utils.quantities module. Thanks to this discussion on SO.

I noted that PercentageField doesn’t use lino.utils.quantities. This field is currently just a thin wrapper around DecimalField, and Lino adds a percent sign when printing it. One day we might change this (#2941).