Opened 18 years ago
Closed 18 years ago
#3065 closed defect (fixed)
NewForms RadioSelect render problem
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Using a RadioSelect in a form, it fails to render.
Test code below (tested in r4105):
from django.newforms import * class TestForm(Form): url = CharField(max_length=100, required=False) test_field1 = ChoiceField(choices=(('1', '1'), ('2', '2'))) test_field2 = ChoiceField(choices=(('1', '1'), ('2', '2')), widget=RadioSelect()) t = TestForm() print t['url'] print t['test_field1'] print t['test_field2']
gives an error on the last line:
TypeError: str returned non-string (type RadioFieldRenderer)
Wrapping the return value of widgets.py RadioSelect.render() in str() fixes.
Change History (2)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Thanks for reporting this. For the record, wrapping that value in
str()
is *not* the correct solution. I'm working on the fix.