title: Annotate count of field value occurances in another model
body: <p>Using Django 1.11. These are my models:</p>
  
  <pre><code>class UserPromoCode(models.Model):
      promo_code = models.ForeignKey(PromoCode, related_name="user_promo_code")
  
  class PromoCode(models.Model):
      code = models.CharField(max_length=20)
  </code></pre>
  
  <p>I need a queryset that in one or two DB requests does this:</p>
  
  <pre><code>promocodes = PromoCode.objects.all()
  for p in promocodes:
     p.assigned_times = UserPromoCode.objects.filter(promo_code__code=p.code).count()
  </code></pre>
  
  <p>The thing is that PromoCode.code is not unique, so I can't do <code>PromoCode.objects.annontate(assigned_times=Count('user_promo_code'))</code> which is analog of:</p>
  
  <pre><code>promocodes = PromoCode.objects.all()
  for p in promocodes:
     p.assigned_times = p.user_promo_code.count()
  </code></pre>
  
  <p>I guess it should be something like PromoCode.objects.annontate(assigned_times=Count(???)).</p>