Just in case anyone else has the same problem and finds their way here...

The answers were there in the documentation once I rooted around for a 
while. I just need to override the default form field provided for my time 
model field and explicitly specify the allowed formats.

class EntryForm(ModelForm):
    time = TimeField(required=True,
                     error_messages = {'invalid' :
                                       "Please enter a time of the form 
HH:MM"},
                     widget=TimeInput(format='%H:%M'),
                     input_formats=['%H:%M'])
    class Meta:
        model = Entry
        # time is a models.TimeField in entry/models.py

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/EDD9Y_G4czAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to