Fixed #11301 - Properly hide SplitHiddenDateTimeWidget. Thanks to David Gouldin for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
341c85bed0
commit
4700200383
1
AUTHORS
1
AUTHORS
|
@ -185,6 +185,7 @@ answer newbie questions, and generally made Django that much better:
|
|||
GomoX <gomo@datafull.com>
|
||||
Guilherme Mesquita Gondim <semente@taurinus.org>
|
||||
Mario Gonzalez <gonzalemario@gmail.com>
|
||||
David Gouldin <dgouldin@gmail.com>
|
||||
pradeep.gowda@gmail.com
|
||||
Collin Grady <collin@collingrady.com>
|
||||
Simon Greenhill <dev@simon.net.nz>
|
||||
|
|
|
@ -725,6 +725,8 @@ class SplitHiddenDateTimeWidget(SplitDateTimeWidget):
|
|||
"""
|
||||
A Widget that splits datetime input into two <input type="hidden"> inputs.
|
||||
"""
|
||||
is_hidden = True
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
widgets = (HiddenInput(attrs=attrs), HiddenInput(attrs=attrs))
|
||||
super(SplitDateTimeWidget, self).__init__(widgets, attrs)
|
||||
|
|
|
@ -1846,4 +1846,15 @@ True
|
|||
</select></td></tr>
|
||||
|
||||
|
||||
|
||||
# Checking that the label for SplitDateTimeField is not being displayed #####
|
||||
|
||||
>>> from django.forms import *
|
||||
>>> class EventForm(Form):
|
||||
... happened_at = SplitDateTimeField(widget=widgets.SplitHiddenDateTimeWidget)
|
||||
...
|
||||
>>> form = EventForm()
|
||||
>>> form.as_ul()
|
||||
u'<input type="hidden" name="happened_at_0" id="id_happened_at_0" /><input type="hidden" name="happened_at_1" id="id_happened_at_1" />'
|
||||
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue