它应该很简单,但我找不到如何检查是否选择了一个单选按钮
class ViewSettingsForm (forms.Form):
CHOICES=[('select1','select 1',),
('select2','select 2'), ('select3','select 3')]
like = forms.ChoiceField(choices=CHOICES, widget=forms.RadioSelect())
name = forms.ChoiceField()
def view_settings (request) :
owner = request.user
if request.POST:
# ??? How to check that something was selected
else :
form = ViewSettingsForm ()