diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-09-26 04:37:10 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2006-09-26 04:37:10 +0000 |
| commit | be053df69341e98ef46c6ec3429d8f0812aab9f0 (patch) | |
| tree | 083f4c6c0123b1f18362627dceff587ce75339c3 | |
| parent | 11416e4a54425e4ea91a509fe25d94afb27a1e83 (diff) | |
Fixed #2300 -- Added required "value" attribute to CheckboxSelectMultipleField
form field. Converted the submitted data for the same field back into something
we can work with. Thanks, lerouxb@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3850 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/forms/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/forms/__init__.py b/django/forms/__init__.py index 759a32ba81..5f47059f03 100644 --- a/django/forms/__init__.py +++ b/django/forms/__init__.py @@ -54,6 +54,7 @@ class Manipulator(object): def get_validation_errors(self, new_data): "Returns dictionary mapping field_names to error-message lists" errors = {} + self.prepare(new_data) for field in self.fields: errors.update(field.get_validation_errors(new_data)) val_name = 'validate_%s' % field.field_name @@ -638,7 +639,7 @@ class CheckboxSelectMultipleField(SelectMultipleField): if str(value) in str_data_list: checked_html = ' checked="checked"' field_name = '%s%s' % (self.field_name, value) - output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s /> <label for="%s">%s</label></li>' % \ + output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s value="on" /> <label for="%s">%s</label></li>' % \ (self.get_id() + escape(value), self.__class__.__name__, field_name, checked_html, self.get_id() + escape(value), choice)) output.append('</ul>') |
