diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-23 17:33:09 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-23 17:33:09 +0000 |
| commit | 8a3ef1f8bce338b2ca255177b4ba6d020fd05bca (patch) | |
| tree | 665cae0b70f0fea5f04c48eca5a8088d4065aa4c /django/forms/fields.py | |
| parent | 646f2f6101cda3e20908928de44739dfff596b0f (diff) | |
Fixed #7499 -- Trim microseconds off rendering of form.TimeFields by default so
that they validate. Previous code didn't work with microseconds anyway, so this
is backwards compatible. Thanks to kevin for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms/fields.py')
| -rw-r--r-- | django/forms/fields.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 5537cf66f9..02c4c3db88 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -27,14 +27,14 @@ from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode, smart_str from util import ErrorList, ValidationError -from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateTimeInput +from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateTimeInput, TimeInput from django.core.files.uploadedfile import SimpleUploadedFile as UploadedFile __all__ = ( 'Field', 'CharField', 'IntegerField', 'DEFAULT_DATE_INPUT_FORMATS', 'DateField', 'DEFAULT_TIME_INPUT_FORMATS', 'TimeField', - 'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField', + 'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField', 'TimeField', 'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField', 'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField', 'ComboField', 'MultiValueField', 'FloatField', 'DecimalField', @@ -311,6 +311,7 @@ DEFAULT_TIME_INPUT_FORMATS = ( ) class TimeField(Field): + widget = TimeInput() default_error_messages = { 'invalid': _(u'Enter a valid time.') } |
