Ticket #4237: radio_select.diff

File radio_select.diff, 843 bytes (added by Robert Myers <myer0052@…>, 18 years ago)

use RadioSelect widget if radio_admin=True

  • django/db/models/fields/__init__.py

     
    345345        "Returns a django.newforms.Field instance for this database Field."
    346346        defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}
    347347        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())
    349352        defaults.update(kwargs)
    350353        return form_class(**defaults)
    351354
Back to Top