[Answered ]-Django, unicode object has no attribute pk

2👍

Since are using a model multiple choice field, you should use a regular queryset instead of values().

thedomains = Domain.objects.all()
self.fields["skills"] = forms.ModelMultipleChoiceField(queryset=thedomains, widget=forms.CheckboxSelectMultiple())

Leave a comment