Opened 6 years ago

Closed 5 years ago

#11301 closed (fixed)

Fields using SplitHiddenDateTimeWidget are still rendered with their label

Reported by: dgouldin Owned by: nobody
Component: Forms Version: 1.0
Severity: Keywords:
Cc: dgouldin@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Using the following form class:

from django import forms
class TestForm(forms.Form):
    test_field = forms.SplitDateTimeField(widget=forms.widgets.SplitHiddenDateTimeWidget)

an instance of this class will render with a label for test_field:

>>> f = TestForm()
>>> f.as_table()
u'<tr><th><label for="id_test_field_0">Test field:</label></th><td><input type="hidden" name="test_field_0" id="id_test_field_0" /><input type="hidden" name="test_field_1" id="id_test_field_1" /></td></tr>'

Attachments (2)

11301.diff (509 bytes) - added by dgouldin 6 years ago.
hide_label_splitdatetimefield.diff (1.2 KB) - added by punteney 6 years ago.
updated patch with test case

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by dgouldin

comment:1 Changed 6 years ago by dgouldin

  • Cc dgouldin@… added
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by SmileyChris

  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

Changed 6 years ago by punteney

updated patch with test case

comment:3 Changed 6 years ago by punteney

  • Needs tests unset

updated patch with a test case

comment:4 Changed 5 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

(In [12152]) Fixed #11301 - Properly hide SplitHiddenDateTimeWidget. Thanks to David Gouldin for the patch.

Note: See TracTickets for help on using tickets.
Back to Top