Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save extra fields #3

Open
Maestro1 opened this issue Sep 26, 2018 · 0 comments
Open

Unable to save extra fields #3

Maestro1 opened this issue Sep 26, 2018 · 0 comments

Comments

@Maestro1
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant