i have the following django form . which has a choice field. im trying to get the value selected in the radioSelect widget . im using (cleaned_data) method for this task.
but it cant access the method cleaned_data for some reason.
Exception Value :'AnswersForm' object has no attribute 'cleaned_data'
forms.py:
class AnswersForm(forms.Form):
CHOICES=[('sf','asdf')]
answers = forms.ChoiceField(choices=CHOICES, widget=forms.RadioSelect())
and in views.py:
form = forms.AnswersForm()
form.cleaned_data['answers']
does anyone know what is going on ? or is there another way to perform this ?
thanks in advance