Django

Code

Changeset 5669

Show
Ignore:
Timestamp:
07/12/07 08:37:59 (1 year ago)
Author:
russellm
Message:

Fixed #4755 -- Modified newforms MultipleChoiceField? to use list comprehension, rather than iteration.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/newforms/fields.py

    r5609 r5669  
    447447        if not isinstance(value, (list, tuple)): 
    448448            raise ValidationError(ugettext(u'Enter a list of values.')) 
    449         new_value = [] 
    450         for val in value: 
    451             val = smart_unicode(val) 
    452             new_value.append(val) 
     449        new_value = [smart_unicode(val) for val in value] 
    453450        # Validate that each value in the value list is in self.choices. 
    454451        valid_values = set([smart_unicode(k) for k, v in self.choices])