title: How to join one table with grouped values from different query?
body: <p>I have a models like this:</p>
  
  <pre><code>class Subscription(models.Model):
      visable_name = models.CharField(max_length=50, unique=True)
  
      recipe_name = models.CharField(max_length=50)
      website_url = models.URLField()
  
  
  class User(models.Model):
      username = models.CharField(max_length=50)
  
  
  class UserSubs(models.Model):
      subscription = models.ForeignKey(Subscription, to_field='visable_name')
      user = models.ForeignKey(User, to_field='username')
  </code></pre>
  
  <p>And I want to prepare simple ranking, so I came up with something like this:</p>
  
  <pre><code>rank = UserSubs.objects.values('subscription').
                          annotate(total=Count('user')).
                          order_by('-total')`
  </code></pre>
  
  <p>what gives:</p>
  
  <pre><code>&gt;&gt; rank
  [
     {'total': 3, 'subscription': u'onet'}, 
     {'total': 2, 'subscription': u'niebezpiecznik'}, 
     {'total': 1, 'subscription': u'gazeta'}
  ]
  </code></pre>
  
  <p>what I need, is similar list of full objects:</p>
  
  <pre><code>[
     {'total': 3, 'subscription': &lt;Subscription: onet&gt;}, 
     {'total': 2, 'subscription': &lt;Subscription: niebezpiecznik&gt;}, 
     {'total': 1, 'subscription': &lt;Subscription: gazeta&gt;}
  ]
  </code></pre>
  
  <p>I am not sure, whether 'select_related' will be helpful here, but I can't figured out how to use it :(</p>