pelase see bleow model defination
class Product(models.Model):
name = models.CharField(max_length=200, blank=True, null=True)
prduct_type = models.CharField(max_length=30, blank=True, null=True)
class ProductRateInfo(models.Model):
product= models.ForeignKey(Product, on_delete=models.CASCADE, related_name='rate_info')
season_start = models.DateField(blank=True, null=True)
season_end = models.DateField(blank=True, null=True)
sbr_rate = models.FloatField(default=0)
While feteching the product we need apply sorting ProductRateInfo.sbr_rate column
Tried below method but its not working
product_qs = Product.object.fitler(prduct_type='demotest').prefetch_related('rate_info')
Thanks in advance