Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #11301 - Properly hide SplitHiddenDateTimeWidget. Thanks to Dav…

…id Gouldin for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4700200383f69495724cffa0c8be33f16c29409a 1 parent 341c85b
Jannis Leidel authored January 09, 2010
1  AUTHORS
@@ -185,6 +185,7 @@ answer newbie questions, and generally made Django that much better:
185 185
     GomoX <gomo@datafull.com>
186 186
     Guilherme Mesquita Gondim <semente@taurinus.org>
187 187
     Mario Gonzalez <gonzalemario@gmail.com>
  188
+    David Gouldin <dgouldin@gmail.com>
188 189
     pradeep.gowda@gmail.com
189 190
     Collin Grady <collin@collingrady.com>
190 191
     Simon Greenhill <dev@simon.net.nz>
2  django/forms/widgets.py
@@ -725,6 +725,8 @@ class SplitHiddenDateTimeWidget(SplitDateTimeWidget):
725 725
     """
726 726
     A Widget that splits datetime input into two <input type="hidden"> inputs.
727 727
     """
  728
+    is_hidden = True
  729
+
728 730
     def __init__(self, attrs=None):
729 731
         widgets = (HiddenInput(attrs=attrs), HiddenInput(attrs=attrs))
730 732
         super(SplitDateTimeWidget, self).__init__(widgets, attrs)
11  tests/regressiontests/forms/forms.py
@@ -1846,4 +1846,15 @@
1846 1846
 </select></td></tr>
1847 1847
 
1848 1848
 
  1849
+
  1850
+# Checking that the label for SplitDateTimeField is not being displayed #####
  1851
+
  1852
+>>> from django.forms import *
  1853
+>>> class EventForm(Form):
  1854
+...     happened_at = SplitDateTimeField(widget=widgets.SplitHiddenDateTimeWidget)
  1855
+...
  1856
+>>> form = EventForm()
  1857
+>>> form.as_ul()
  1858
+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" />'
  1859
+
1849 1860
 """

0 notes on commit 4700200

Please sign in to comment.
Something went wrong with that request. Please try again.