Changes between Initial Version and Version 1 of Ticket #3482, comment 7
- Timestamp:
- Sep 2, 2021, 3:18:29 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3482, comment 7
initial v1 1 So, it's hard to say about the dark-history here, as bootstrapping a very old environment is somewhat fiddly these days but [https://github.com/django/django/blob/d0ea01af2814e276c4a090e599d5fd11c6ce4bf8/django/forms/fields.py#L884-L890 the logic here] is virtually unchanged from the [https://github.com/django/django/commit/6645d1fe48868814e4c73056b68be5c3861ed2d0#diff-19fae1b4e3786d4af8cdf8db08d18d687caeae43859b35c769deb96d3aacf05cR256-R260 earliest days of the MultipleChoiceField implementation]. It's certainly unchanged as far back as Django 1.8. Without a serious case being made, the backwards compatibility concerns preclude changing this now.1 So, it's hard to say about the dark-history here, as bootstrapping a very old environment is somewhat fiddly these days but [https://github.com/django/django/blob/d0ea01af2814e276c4a090e599d5fd11c6ce4bf8/django/forms/fields.py#L884-L890 the logic here] is virtually unchanged from the [https://github.com/django/django/commit/6645d1fe48868814e4c73056b68be5c3861ed2d0#diff-19fae1b4e3786d4af8cdf8db08d18d687caeae43859b35c769deb96d3aacf05cR256-R260 earliest days of the MultipleChoiceField implementation]. This behaviour is certainly unchanged as far back as Django 1.8. Without a serious case being made, the backwards compatibility concerns preclude changing this now. 2 2 3 3 However, for me, this is expected behaviour: `''` is **not** a valid choice. If I want filtering of empty values then I'm expecting to use a widget to filter this in `value_from_datadict`, or else a field subclass, if I want the behaviour there. The default implementation is doing the right thing here rejecting the incorrect value.