mirror of
https://github.com/django/django.git
synced 2025-11-02 04:48:33 +00:00
Fixed #7975 -- Callable defaults in inline model formsets now work correctly. Based on patch from msaelices. Thanks for your hard work msaelices.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ca7db155aa
commit
7c7ad041b3
6 changed files with 149 additions and 22 deletions
|
|
@ -1093,7 +1093,7 @@ u'<input type="text" name="date" value="2007-09-17 12:51:34" />'
|
|||
>>> w.render('date', datetime.datetime(2007, 9, 17, 12, 51))
|
||||
u'<input type="text" name="date" value="2007-09-17 12:51:00" />'
|
||||
|
||||
# TimeInput ###############################################################
|
||||
# TimeInput ###################################################################
|
||||
|
||||
>>> w = TimeInput()
|
||||
>>> w.render('time', None)
|
||||
|
|
@ -1113,5 +1113,20 @@ u'<input type="text" name="time" value="12:51:00" />'
|
|||
We should be able to initialize from a unicode value.
|
||||
>>> w.render('time', u'13:12:11')
|
||||
u'<input type="text" name="time" value="13:12:11" />'
|
||||
|
||||
# SplitHiddenDateTimeWidget ###################################################
|
||||
|
||||
>>> from django.forms.widgets import SplitHiddenDateTimeWidget
|
||||
|
||||
>>> w = SplitHiddenDateTimeWidget()
|
||||
>>> w.render('date', '')
|
||||
u'<input type="hidden" name="date_0" /><input type="hidden" name="date_1" />'
|
||||
>>> w.render('date', d)
|
||||
u'<input type="hidden" name="date_0" value="2007-09-17" /><input type="hidden" name="date_1" value="12:51:34" />'
|
||||
>>> w.render('date', datetime.datetime(2007, 9, 17, 12, 51, 34))
|
||||
u'<input type="hidden" name="date_0" value="2007-09-17" /><input type="hidden" name="date_1" value="12:51:34" />'
|
||||
>>> w.render('date', datetime.datetime(2007, 9, 17, 12, 51))
|
||||
u'<input type="hidden" name="date_0" value="2007-09-17" /><input type="hidden" name="date_1" value="12:51:00" />'
|
||||
|
||||
"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue