Apologies for not getting back to you on this - I've been meaning to
take a look at the problem you are reporting, but I keep getting
distracted with other things.
At this point, the best approach would be to open a ticket, and
include a minimal example that demonstrates the problem. Otherwise
this issue will get lost in the flow.
Yours,
Russ Magee %-)
I'm not getting the same problem. Here's my sample Admin class,
controlling a Poll/Choice example that has been augmented with a
'flavour' field (just so I can have something that needs a radio
option):
class PollAdmin(admin.ModelAdmin):
inlines = [admin.TabularInline(Choice, extra=2)]
fields = (
('main', {
'fields': ('question','participants','flavour'),
}),
)
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'flavour':
return
forms.ChoiceField(choices=FLAVOURS,widget=forms.RadioSelect,**kwargs)
else:
return
super(PollAdmin,self).formfield_for_dbfield(db_field,**kwargs)
Does this correlate with what your admin class, or have you done
something different?
Regarding your suggested fix: Looking at the code (r5628,
django/newforms/forms.py, line 259), a BoundField already contains a
similar code - when you render a bound field, it passes the rendered
output through unicode, with a comment specifically mentioning
RadioSelect.
Yours,
Russ Magee %-)