title: All the values of the many to many field : Django
body: <p>I have two models:</p>
  
  <pre><code>class Author(models.Model);
      name = models.CharField(max_length=255)
  
  class Book(models.Model):
      title = models.CharField(max_length=255)
      authors = models.ManyToManyField(Author, null=True, blank=True)
  </code></pre>
  
  <p>Now, I want the info of all the books. So, I did:</p>
  
  <pre><code>book_info = Book.objects.all().values('title', 'authors__name')
  </code></pre>
  
  <p>And, it gives an output like (for 1 book having 2 authors):</p>
  
  <pre><code>[{'title': u'book1', 'authors__name': u'author1'},{'title': u'book1', 'authors__name': u'author2'}]
  </code></pre>
  
  <p>What I wanted was something like:</p>
  
  <pre><code>[{'title': u'book1', 'authors': [{'name':u'author1'},{'name':u'author2'}]}]
  </code></pre>
  
  <p>I may have more fields in the author model, so would like to get those fields as well.</p>
  
  <p>Can I do this in a single query?</p>
  
  <p>What can I do to get something like the desired result?</p>