I have a Subject
model and a CustomUser
model. During registration users can select multiple subjects. The following is my code in forms.
forms.py
class SignUpForm(forms.Form):
...
subjects = forms.ModelMultipleChoiceField(label="Subjects",
widget=forms.CheckboxSelectMultiple,
queryset=Subject.objects.all())
What can I do in views.py
to save this data? The usual method of cleaning the data and then using the save method doesn't work unfortunately. Scarily, similar questions have very little to no answers in SO.