title: How to update manytomany field in Django?
body: <p>Here's an example:</p>
  
  <p>If I have these classes</p>
  
  <pre><code>class Author(models.Model):
      name = models.CharField(max_length=45)
  
  class Book(models.Model):
      name = models.CharField(max_length=45)
      authors = models.ManyToManyField(Author)
  </code></pre>
  
  <p>In the database I have one Author with the name "George" and another one with the name "Georfe". The last one is a mistake. So what I want is in every Book that have "Georfe" as one of his Author replace it by the Author "George".</p>
  
  <p>In SQL is really easy to do. If id of "George" = 3 and id of "Georfe" = 7 and the relation table name is "author_book":</p>
  
  <pre><code>UPDATE author_book SET id=3 WHERE id=7;
  </code></pre>
  
  <p>Is it possible to do that with the Django ORM?</p>
  
  <p>I found a way to do it: I loop trough all the related Books of the mistyped author and do:</p>
  
  <pre><code>book.authors.add(Author.objects.get(id=3))
  book.authors.remove(Author.objects.get(id=7))
  </code></pre>
  
  <p>But I don't find this solution really elegant and efficient. Is there a solution without the loop?</p>