You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I added a field year to Student model.I want to extend the app so that students can view quizzes that are just for their year of study.
In the forms.py in StudentSignUpForm I added year = forms.ModelChoiceField(
queryset=Year.objects.all(),
required=True
)
in def save(self):
student.year.add(*self.cleaned_data.get('year'))
It gives an error 'NoneType' object has no attribute 'add'
Assist in solving this or give pointers on how to solve
The text was updated successfully, but these errors were encountered:
Hello. I added a field year to Student model.I want to extend the app so that students can view quizzes that are just for their year of study.
In the forms.py in StudentSignUpForm I added year = forms.ModelChoiceField(
queryset=Year.objects.all(),
required=True
)
in def save(self):
student.year.add(*self.cleaned_data.get('year'))
It gives an error 'NoneType' object has no attribute 'add'
Assist in solving this or give pointers on how to solve
The text was updated successfully, but these errors were encountered: