title: How to get the related models first objects in a single query in Django?
body: <pre><code> class Product(models.Model):
       category = models.ForeignKey(Category, related_name=&quot;products_category&quot;, null=True, on_delete=models.CASCADE)
       sku = models.CharField(max_length=200, blank=True, null=True)
  
   class ProductVariants(DateTimeModel):
       name = models.CharField(max_length=200, blank=True, null=True)
       product = models.ForeignKey(Product, related_name=&quot;products_variants&quot;, null=True, on_delete=models.CASCADE)
  </code></pre>
  <p><code>products = Product.objects.select_related('category')</code>
  how to get all the parent model objects with their related model's first object in a single query. <code>[0] and first()</code> is not working. how to fetch that?</p>