You could do this:
class FormWithoutBug(forms.Form):
attrs = {'type':'time', 'required':'true'}
session_start =
forms.TimeField(widget=forms.TimeInput(attrs=attrs.copy()))
session_end =
forms.TimeField(widget=forms.TimeInput(attrs=attrs.copy()))
--
You received this message because
Hello,
Interesting. Sounds like something that could be documented.
Collin
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroup
When a dictionary is passed to a Widget as the `attr` kwarg, to be used in
filling HTML attributes, this dictionary is mutated, so cannot be reused.
See below example to see a clear problem with this. Note how in the first
form, when printer as_p(), the second field (session_end) gets an incorre
3 matches
Mail list logo