mirror of
https://github.com/django/django.git
synced 2025-10-27 07:36:08 +00:00
Fixed #3490 -- Fixed issue with newforms ChoiceField and generators as choices. Thanksfor the patch, Chris.Wesseling@cwi.nl
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4549 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -339,8 +339,9 @@ class ChoiceField(Field):
|
||||
|
||||
def _set_choices(self, value):
|
||||
# Setting choices also sets the choices on the widget.
|
||||
self._choices = value
|
||||
self.widget.choices = value
|
||||
# choices can be any iterable, but we call list() on it because
|
||||
# it will be consumed more than once.
|
||||
self._choices = self.widget.choices = list(value)
|
||||
|
||||
choices = property(_get_choices, _set_choices)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user