﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7499	TimeField may contain the sub-second times but cannot validate them	honeyman	Kevin McConnell	"If we create a form containing a TimeField which has the initial value set to time object which contains the sub-second data (for example, to time.max), the form is generated with the value which cannot be validated.
Example:
{{{
>>> from django import newforms as forms
>>> from datetime import time
>>>
>>> class MyForm(forms.Form):
...     mytime = forms.TimeField(initial = time.max)
...
>>> f1 = MyForm()
>>> # Imagine we've posted this form and are now parsing the POST request
... f1a = MyForm({'mytime': str(time.max)})
>>>
>>> print f1
<tr><th><label for=""id_mytime"">Mytime:</label></th><td><input type=""text"" name=""mytime"" value=""23:59
:59.999999"" id=""id_mytime"" /></td></tr>
>>>
>>> print f1a
<tr><th><label for=""id_mytime"">Mytime:</label></th><td><ul class=""errorlist""><li>Enter a valid time.
</li></ul><input type=""text"" name=""mytime"" value=""23:59:59.999999"" id=""id_mytime"" /></td></tr>
>>>
>>> print f1a.is_bound, f1a.is_valid()
True False
}}}

As Django (Python) cannot parse the sub-second time in the text string, my understanding is that Django should never print it in the field, trimming the value to just '%H:%M:%S'.

This is likely applicable to DateTimeField too."		closed	Forms	dev		fixed	time aug22sprint	kevin.mcconnell@…	Ready for checkin	1	0	0	0	0	0
