Opened 18 years ago

Closed 18 years ago

Last modified 13 years ago

#3671 closed Uncategorized (fixed)

Specify a selected item in widget.RadioSelect() for a BooleanField

Reported by: David Larlet <larlet@…> 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 David Larlet <larlet@…>, 18 years ago

Resolution: fixed
Status: newclosed

Ok, forget about that and sorry for the noise.

Solution is initial='2' in BooleanField.

in reply to:  description comment:2 by fazal.sulaiman@…, 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.
Back to Top