title: Django filter objects by distinct fields and get the latest items
body: <p>I have a model defined as:</p>
  
  <pre><code>from django.db import models
  
  class BookManager(models.Manager):
      def latest_book(self):
          return super(BookManager, self).get_queryset().filter(something)
  
  class Book(models.Model):
      name = models.CharField(max_length=200)
      author = models.CharField(max_length=200)
      version = models.IntegerField(default=0)
  
      objects = BookManager()
  
      def __unicode__(self):
          return "%s : %s : %s" % (self.name, self.author, self.version)
  </code></pre>
  
  <p>A book with same name and author is considered as the same book, but they can have different versions. I want to filter out the latest (by comparing version) book of (name + author), for example:</p>
  
  <p>There is such books:</p>
  
  <pre><code>Good Time : Andy : 1
  Good Time : Andy : 2
  Good Time : Andy : 3
  My Django Book : Jim : 1
  My Django Book : Jim : 2
  My Django Book : Jim : 3
  Python Tutorial : Tom : 1
  Python Tutorial : Tom : 2
  Python Tutorial : Tom : 3
  Python Tutorial : Tom : 4
  Python CookBook : Tom : 1
  Python CookBook : Tom : 2
  </code></pre>
  
  <p>I want to filter it with:</p>
  
  <pre><code>from books.models import Book
  Book.objects.latest_book()
  </code></pre>
  
  <p>And get expect result as:</p>
  
  <pre><code> &lt;Book: Good Time : Andy : 3&gt;
   &lt;Book: My Django Book : Jim : 3&gt;
   &lt;Book: Python Tutorial : Tom : 4&gt;
   &lt;Book: Python CookBook : Tom : 2&gt;
  </code></pre>
  
  <p>How can I write the filter ( filer(something) in above code)?</p>