Ticket #11644: fields.py.diff
File fields.py.diff, 729 bytes (added by , 15 years ago) |
---|
-
fields.py
634 634 def _get_choices(self): 635 635 return self._choices 636 636 637 def _set_choices(self, value):637 def _set_choices(self, choices): 638 638 # Setting choices also sets the choices on the widget. 639 639 # choices can be any iterable, but we call list() on it because 640 640 # it will be consumed more than once. 641 self._choices = self.widget.choices = list(value)641 self._choices = self.widget.choices = [choice if isinstance(choice, tuple) else (choice, choice) for choice in choices] 642 642 643 643 choices = property(_get_choices, _set_choices) 644 644