Ticket #8898: 8898-DateTimeField-r8966.diff
File 8898-DateTimeField-r8966.diff, 2.0 KB (added by , 16 years ago) |
---|
-
django/forms/fields.py
381 381 # components: date and time. 382 382 if len(value) != 2: 383 383 raise ValidationError(self.error_messages['invalid']) 384 if value[0] in EMPTY_VALUES and value[1] in EMPTY_VALUES: 385 if self.required: 386 raise ValidationError(self.error_messages['required']) 387 return value 384 388 value = '%s %s' % tuple(value) 385 389 for format in self.input_formats: 386 390 try: -
tests/regressiontests/forms/fields.py
619 619 >>> repr(f.clean('')) 620 620 'None' 621 621 622 Regression test for #8898. 623 >>> f = DateTimeField(widget=SplitDateTimeWidget) 624 >>> f.clean(['', '']) 625 Traceback (most recent call last): 626 ... 627 ValidationError: [u'This field is required.'] 628 >>> f = DateTimeField(required=False, widget=SplitDateTimeWidget) 629 >>> f.clean(['', '']) 630 ['', ''] 631 622 632 # RegexField ################################################################## 623 633 624 634 >>> f = RegexField('^\d[A-F]\d$') -
AUTHORS
239 239 Eugene Lazutkin <http://lazutkin.com/blog/> 240 240 lcordier@point45.com 241 241 Jeong-Min Lee <falsetru@gmail.com> 242 Tai Lee <real.human@mrmachine.net> 242 243 Jannis Leidel <jl@websushi.org> 243 244 Christopher Lenz <http://www.cmlenz.net/> 244 245 lerouxb@gmail.com … … 278 279 Aljosa Mohorovic <aljosa.mohorovic@gmail.com> 279 280 Ramiro Morales <rm0@gmx.net> 280 281 Eric Moritz <http://eric.themoritzfamily.com/> 281 mrmachine <real.human@mrmachine.net>282 282 Robin Munn <http://www.geekforgod.com/> 283 283 James Murty 284 284 msundstr