From 8b11341a9a706f2a239d9e4eec1c093b4e93fecb Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Sun, 31 Aug 2008 20:11:28 +0000 Subject: [PATCH] Fixed `ModelAdmin.radio_fields` to work with the new `TypedChoiceField`. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8773 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/options.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 62e4aaedc3..f01edbcb28 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -51,12 +51,12 @@ class BaseModelAdmin(object): if db_field.choices: if db_field.name in self.radio_fields: # If the field is named as a radio_field, use a RadioSelect - kwargs['widget'] = widgets.AdminRadioSelect( - choices=db_field.get_choices(include_blank=db_field.blank, - blank_choice=[('', _('None'))]), - attrs={ - 'class': get_ul_class(self.radio_fields[db_field.name]), - } + kwargs['widget'] = widgets.AdminRadioSelect(attrs={ + 'class': get_ul_class(self.radio_fields[db_field.name]), + }) + kwargs['choices'] = db_field.get_choices( + include_blank = db_field.blank, + blank_choice=[('', _('None'))] ) return db_field.formfield(**kwargs) else: