title: how can I limit the count of returned objects from a related manager in django
body: <p>I have two models Category and Product</p>
  
  <pre class="lang-py prettyprint-override"><code>class Category(models.Model):
      name = models.CharField(max_length=200,
                                 db_index=True)
      slug = models.SlugField(max_length=200,
                              unique=True,)
      description = models.CharField(max_length=50,
                                        blank=True)
  
  
  
  class Product(models.Model):
      category = models.ForeignKey(Category,
                                   related_name='products',
                                   on_delete=models.CASCADE)
      name = models.CharField(max_length=200,
                                 db_index=True)
      description = models.TextField(blank=True)
      slug = models.SlugField(max_length=200, db_index=True)
      price = models.DecimalField(max_digits=10, decimal_places=2)
      available = models.BooleanField(default=True)
      featured = models.BooleanField(default=False)
      created = models.DateTimeField(auto_now_add=True)
      updated = models.DateTimeField(auto_now=True)
  </code></pre>
  
  <p>the wanted behavior is to return all categories with and each category should include 10 products</p>
  
  <p>I tried to return all categories without limiting the products returned objects then I used the slice filter in the templates, but I am not sure if this is efficient for big scale and I am not sure if Django will lazy-load the products.
  right now the view is as follows</p>
  
  <pre class="lang-py prettyprint-override"><code>def product_list(request):
      featured_products = Product.objects.filter(featured=True).all()
      categories = Category.objects.all()
  
      return render(request,
                    template_name='home/home.html',
                    context={'categories': categories,
                             'featured_products': featured_products})
  
  </code></pre>
  
  <p>is the way I am using is efficient or I should limit the products when querying the categories using <code>Category.objects.all()</code>?</p>