1
0
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:
Adrian Holovaty
2007-02-20 03:05:09 +00:00
parent bdfbcb2cd5
commit a52cc03374
3 changed files with 16 additions and 2 deletions

View File

@@ -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)