Ticket #3114: multiple_choice_4194.patch
File multiple_choice_4194.patch, 1.5 KB (added by , 18 years ago) |
---|
-
django/newforms/forms.py
2 2 Form classes 3 3 """ 4 4 5 from django.utils.datastructures import SortedDict 5 from django.utils.datastructures import SortedDict, MultiValueDict 6 6 from django.utils.html import escape 7 7 from fields import Field 8 8 from widgets import TextInput, Textarea, HiddenInput … … 221 221 222 222 def _data(self): 223 223 "Returns the data for this BoundField, or None if it wasn't given." 224 if isinstance(self.form.data, MultiValueDict) and self.field.widget.requires_data_list: 225 return self.form.data.getlist(self.name) 224 226 return self.form.data.get(self.name, None) 225 227 data = property(_data) 226 228 -
django/newforms/widgets.py
10 10 11 11 from util import StrAndUnicode, smart_unicode 12 12 from django.utils.html import escape 13 from django.utils.datastructures import MultiValueDict 13 14 from itertools import chain 14 15 15 16 try: … … 43 44 Given a dictionary of data and this widget's name, returns the value 44 45 of this widget. Returns None if it's not provided. 45 46 """ 47 if isinstance(data, MultiValueDict) and self.requires_data_list: 48 return data.getlist(name) 46 49 return data.get(name, None) 47 50 48 51 def id_for_label(self, id_):