I'm trying to have a select form with a list of months but I can't seem to get it to post correctly.
form:
class MonthForm(forms.Form):
months = [('January','January'),
('February','February'),
('March','March'),
('April','April'),
('May','May'),
('June','June'),
('July','July'),
('August','August'),
('September','September'),
('October','October'),
('November','November'),
('December','December'),]
month = forms.ChoiceField(months)
view:
def table_view(request):
if request.method == 'POST':
month = MonthForm(request.POST).cleaned_data['month']
print month
I keep getting this error:
'MonthForm' object has no attribute 'cleaned_data'