Changes between Initial Version and Version 1 of Ticket #28310
- Timestamp:
- Jun 15, 2017, 8:17:56 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28310
- Property Component Uncategorized → contrib.postgres
- Property Summary (form) RangeFields should handle (None, None) better. → form RangeFields should treat (None, None) as Range(None, None) rather than None
- Property Type Uncategorized → Bug
-
Ticket #28310 – Description
initial v1 1 When you clean a RangeField, and pass it in ('', ''), or (None, None), it falls through to the MultiValueField handling, which, when all values are empty, treats the cleaned value as empty.1 When you clean a `RangeField` and pass it in `('', '')`, or `(None, None)`, it falls through to the `MultiValueField` handling, which, when all values are empty, [https://github.com/django/django/blob/a6b5321ce997b899e540bb427cca98cb2b93a106/django/forms/fields.py#L992 treats the cleaned value as empty]. 2 2 3 https://github.com/django/django/blob/master/django/forms/fields.py#L992 4 5 Thus: 6 7 8 {{{ 9 FloatRangeField().clean([None, None]) 10 }}} 11 12 returns `None`, when it really should return FloatRange(None, None). 3 Thus, `FloatRangeField().clean([None, None])` returns `None`, when it really should return `FloatRange(None, None)`. 13 4 14 5 There is a very large difference between these.