title: Tastypie Dehydrate reverse relation count
body: <p>I have a simple model which includes a product and category table. The Product model has a foreign key Category.</p>
  
  <p>When I make a tastypie API call that returns a list of categories /api/vi/categories/
  I would like to add a field that determines the "product count" / the number of products that have a giving category. The result would be something like:</p>
  
  <pre><code>category_objects[
  { 
     id: 53
     name: Laptops
     product_count: 7
  }, 
  ...
   ]
  </code></pre>
  
  <p>The following code is working but the hit on my DB is heavy</p>
  
  <pre><code>    def dehydrate(self, bundle):
          category = Category.objects.get(pk=bundle.obj.id)
          products = Product.objects.filter(category=category)
          bundle.data['product_count'] = products.count()
          return bundle  
  </code></pre>
  
  <p>Is there a more efficient way to build this query? Perhaps with annotate ?</p>