diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-12 13:37:59 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-12 13:37:59 +0000 |
| commit | a5de16fbe4adbdf960683cbdebea4d4e9db2983d (patch) | |
| tree | d310bc0781b105976d7d42b2af26ddd19a0b38c2 /django | |
| parent | 7f5797e640761c64f5622b858bf56a40a9151738 (diff) | |
Fixed #4755 -- Modified newforms MultipleChoiceField to use list comprehension, rather than iteration.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5669 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/newforms/fields.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/django/newforms/fields.py b/django/newforms/fields.py index b6abea6400..507e763353 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -446,10 +446,7 @@ class MultipleChoiceField(ChoiceField): return [] if not isinstance(value, (list, tuple)): raise ValidationError(ugettext(u'Enter a list of values.')) - new_value = [] - for val in value: - val = smart_unicode(val) - new_value.append(val) + new_value = [smart_unicode(val) for val in value] # Validate that each value in the value list is in self.choices. valid_values = set([smart_unicode(k) for k, v in self.choices]) for val in new_value: |
