title: Django throws 'Direct assignment to the forward side of a many-to-many set is prohibited.' error
body: <p>I have two models in Django <code>Users</code> and <code>Contexts</code>.I have defined the models as below</p>
  
  <pre><code>class User(models.Model):
      userId = models.PositiveIntegerField(null = False)
      pic = models.ImageField(upload_to=getUserImagePath,null=True)
      Email = models.EmailField(null = True)
  
  class Contexts(models.Model):
      context_name = models.CharField(max_length=50)
      context_description = models.TextField()
      context_priority = models.CharField(max_length=1)
      users = models.ManyToManyField(User, related_name='context_users')
  </code></pre>
  
  <p>Now I get a POST request which contains the below JSON</p>
  
  <pre><code>{
  "user" : 12,
  "action" : "add",
  "context_name": "Network debug",
  "context_description" : "Group for debugging network issues",
  "context_priority": "L"
  }
  </code></pre>
  
  <p>I want to create a record in the <code>Contexts</code> table.Below is what I am trying to do</p>
  
  <pre><code>from django.shortcuts import render
  from django.views.decorators.csrf import csrf_exempt
  from django.http import HttpResponse
  import json
  from .models import *
  import json
  
  
  @csrf_exempt
  def context_operation(request):
      if request.method == "POST":
          user_request = json.loads(request.body.decode('utf-8'))
          try:
              if user_request.get("action") == "add":
                  conv = Contexts.objects.create(
                      context_name=user_request.get("context_name"),
                      context_description=user_request.get("context_description"),
                      context_priority=user_request.get("context_priority"),
                      users=user_request.get("user")
                  )
                  conv.save()
          except Exception as e:
              print("Context saving exception", e)
              return HttpResponse(0)
          return HttpResponse(1)
  </code></pre>
  
  <p>Here I am trying to add a context based on the action field in the JSON request.As you can see, in the <code>Contexts</code> model, the field <code>users</code> has many to many relation with the <code>User</code> model.But when I try to save the values to the <code>Contexts table</code>, I recieve the below error</p>
  
  <pre><code>Context saving exception Direct assignment to the forward side of a many-to-many set is prohibited. Use users.set() instead.
  </code></pre>
  
  <p>Based on <a href="https://stackoverflow.com/questions/50015204/direct-assignment-to-the-forward-side-of-a-many-to-many-set-is-prohibited-use-e">this StackOverflow post</a>, I tried doing something like this:</p>
  
  <pre><code>users=User.objects.add(user_request.get("user"))
  </code></pre>
  
  <p>But I still receive the same error. What am I doing wrong?</p>