TLDR: how do I get my timefield to show in the template?
I customized my ModelForm in the class meta. For some reason, only the label change is shown, not the widget change. Here is my code:
class MenuCreateForm(forms.ModelForm):
class Meta:
model = Menu
fields = (
'name',
'monday',
'availability_begin_mon',
'availability_end_mon',
labels = {
'availability_begin_mon': ('Begin Montag'),
'availability_end_mon': ('Ende Montag'),
widgets = {
'availability_begin_mon': forms.TimeInput(format='%H:%M'),
'availability_end_mon': forms.TimeInput(format='%H:%M'),
And here is the template I used:
<form method="POST"> {% csrf_token %}
{{ form.as_p }}
<button class="btn btn-primary" type='submit'>Änderungen speichern</button>
</form>
Does anyone have an idea? Thank you very much!