#3671 closed Uncategorized (fixed)
Specify a selected item in widget.RadioSelect() for a BooleanField
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | 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
Here is my model:
foo = forms.BooleanField(widget=widgets.RadioSelect(choices=[(1, 'Yes'), (2, 'No')]))
I can't specify 'No' as default choice of my radio input.
Change History (2)
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Easy pickings: | unset |
---|---|
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
foo = forms.BooleanField(widget=widgets.RadioSelect(choices=[(1, 'Yes'), (2, 'No')]), initial='1')
Replying to David Larlet <larlet@…>:
Here is my model:
foo = forms.BooleanField(widget=widgets.RadioSelect(choices=[(1, 'Yes'), (2, 'No')]))
I can't specify 'No' as default choice of my radio input.
Note:
See TracTickets
for help on using tickets.
Ok, forget about that and sorry for the noise.
Solution is initial='2' in BooleanField.