title: Direct assignment to the forward side of a many-to-many set is prohibited. Use emails_for_help.set() instead
body: <p>I am new to Django and didn't find any reference regarding this issue. I am getting this error when i use many to many field in Django model (<code>models.py</code>). I guess the issue is assigning m2m field in view(<code>views.py</code>) from form(<code>forms.py</code>). </p>
  
  <p>How to assign m2m field in view?
  (<code>Django version 2.0</code>, <code>python - 3.5</code>)</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class User(AbstractUser):
   username=models.CharField(max_length=20)
   email = models.EmailField(_('email address'), unique=True)
  
  
  class Setupuser(models.Model):
   organization=models.CharField(max_length=200,blank=False,null=True)
   emails_for_help = models.ManyToManyField(User)
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class Set_user(FormView):
   template_name="pkm_templates/set_up_user.html"
   form_class = Set_User_Form
   success_url = '/thanks/'
  
   def form_valid(self, form):
      org = form.cleaned_data.get('organization')
      emails = form.cleaned_data.get("emails_for_help")
      instance = Setupuser(organization=org,emails_for_help=emails)
      instance.save()
      return redirect("/")
  </code></pre>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>class Set_User_Form(ModelForm):
    emails_for_help = forms.ModelMultipleChoiceField(
      queryset=User.objects.all(),
      widget=forms.CheckboxSelectMultiple
    )
  
    class Meta:
      model = Setupuser
      fields = ["organization","emails_for_help"]
  </code></pre>