class EmailTextInput(django.forms.widgets.TextInput):
    """Subclass TextInput since there's no direct way to override its type attribute"""
input_type = 'email'


class MyModelForm(ModelForm):


    class Meta:
        model = MyModel
widgets = {'thedate': EmailTextInput()}
How can I override the 'type' attribute of a ModelForm in Django?