title: Bulk update for many to many fields
body: <p>I have two models as Follows:</p>
  <pre><code>class Book(models.Model):
      title = models.CharField(max_length=100)
      year = models.IntegerField(max_lenght=4)
      author = models.ManyToManyField(null=true, blank=true)
  
  
  class Author(models.CustomUser):
      # some fields
  </code></pre>
  <p>Now, what I am looking to do is add an <code>Author</code> to multiple <code>Book</code> objects without iterating over the list of book objects.</p>
  <p>Django's update method does not support <code>ManyToManyField</code> as per <a href="https://docs.djangoproject.com/en/dev/topics/db/queries/#updating-multiple-objects-at-once" rel="nofollow noreferrer">docs</a>. It says:</p>
  <blockquote>
  <p>You can only set non-relation fields and ForeignKey fields using this method. To update a non-relation field, provide the new value as a constant. To update ForeignKey fields, set the new value to be the new model instance you want to point to.</p>
  </blockquote>
  <p>So currently I am doing the following which is highly inefficient as I'll be hitting the database for each book object.</p>
  <pre><code>author = Author.objects.get(pk=1)
  books = Book.objects.filter(**kwargs) # say this returns 100 objects
  # each loop here will hit the database making it really inefficient
  # for long lists.
  for book in books:
      book.authors.add(author)
      book.save()
  </code></pre>
  <p>I am pretty sure there is a way around this, but I am just not able to find it in the documentation.</p>