Django

Code

Changeset 3850

Show
Ignore:
Timestamp:
09/25/06 23:37:10 (2 years ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/forms/__init__.py

    r3816 r3850  
    5555        "Returns dictionary mapping field_names to error-message lists" 
    5656        errors = {} 
     57        self.prepare(new_data) 
    5758        for field in self.fields: 
    5859            errors.update(field.get_validation_errors(new_data)) 
     
    639640                checked_html = ' checked="checked"' 
    640641            field_name = '%s%s' % (self.field_name, value) 
    641             output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s /> <label for="%s">%s</label></li>' % \ 
     642            output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s value="on" /> <label for="%s">%s</label></li>' % \ 
    642643                (self.get_id() + escape(value), self.__class__.__name__, field_name, checked_html, 
    643644                self.get_id() + escape(value), choice))