django-measurement
django-measurement copied to clipboard
Django admin doesn't show Zero time values
If a time value is zero then it shows as empty in Django Admin. This is an issue while updating the object, I have to enter zero value for Time field every time even though I was updating other fields of model.
instructor_time_required = MeasurementField(measurement=Time, unit_choices=[ ['min', 'min'], ['hr', 'hr'] ], help_text="Total time per instructor that will be spent on delivering this unit", validators=[MinValueValidator(Time(min=0))], )
As field is non null, I have to enter Zero every time
Actual value of the field is Zero as I can see in pgAdmin
Probably issue is there for other measures as well, didn't check.
Hi @codingjoe thanks for reaching out. Yes, this seems to be a bug. Yet, I don't have the capacity to fix it right now, considering I am working on a new major release supporting the rewrite of the underlying Python package. Feel free to provide a patch until then, I would be happy to review it. Otherwise, it will only have time to look into this after the release. Best, Joe