I'm trying to make a NumberInput widget that has steps of 0.5, which is defined in the form as the following:
widgets = {
"hours_per_day": widgets.NumberInput(attrs={'step': '0.5'})
}
However, the template is always rendered with the attribute step being 0.1. This widget is for a ModelForm's DecimalField. Why is the step attribute not changing?
Here's the (useful) code from the form:
class Registration_form(ModelForm):
class Meta:
model = Registration
fields = [
"hours_per_day",
]
widgets = {
"hours_per_day": widgets.NumberInput(attrs={'step': '1'})
}