Ticket #12303: 12303.diff

File 12303.diff, 992 bytes (added by samueladam, 15 years ago)
  • django/forms/fields.py

     
    4343)
    4444
    4545# These values, if given to to_python(), will trigger the self.required check.
    46 EMPTY_VALUES = (None, '')
     46EMPTY_VALUES = (None, '', ['', ''])
    4747
    4848
    4949class Field(object):
  • tests/regressiontests/forms/forms.py

     
    18071807>>> [f.name for f in form.visible_fields()]
    18081808['artist', 'name']
    18091809
     1810# Making required=False work with SplitDateTime ############################
     1811
     1812>>> class SplitDateTimeForm(Form):
     1813...     dt = DateTimeField(required=False,
     1814...             widget=widgets.SplitDateTimeWidget())
     1815>>> f = SplitDateTimeForm({'dt_0': '', 'dt_1': ''})
     1816>>> f.is_valid()
     1817True
     1818
    18101819"""
Back to Top