Ticket #4237: radio_select.diff
File radio_select.diff, 843 bytes (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
345 345 "Returns a django.newforms.Field instance for this database Field." 346 346 defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text} 347 347 if self.choices: 348 defaults['widget'] = forms.Select(choices=self.get_choices()) 348 if self.radio_admin: 349 defaults['widget'] = forms.RadioSelect(choices=self.get_choices_default()) 350 else: 351 defaults['widget'] = forms.Select(choices=self.get_choices_default()) 349 352 defaults.update(kwargs) 350 353 return form_class(**defaults) 351 354