Ticket #3196: choices_patch.diff
File choices_patch.diff, 894 bytes (added by , 18 years ago) |
---|
-
django/newforms/fields.py
310 310 Field.__init__(self, required, widget, label) 311 311 self.choices = choices 312 312 313 def set_choices(self, choices): 314 self.choices = choices 315 self.widget.choices = choices 316 313 317 def clean(self, value): 314 318 """ 315 319 Validates that the input is in self.choices. … … 328 332 def __init__(self, choices=(), required=True, widget=SelectMultiple, label=None): 329 333 ChoiceField.__init__(self, choices, required, widget, label) 330 334 335 def set_choices(self, choices): 336 self.choices = choices 337 self.widget.choices = choices 338 331 339 def clean(self, value): 332 340 """ 333 341 Validates that the input is a list or tuple.