I have 2 tables in my database product and skuoption, the skuoption table has variant_id and this variant_id is storing multiple times with the same fields in skuoption table, please let me know how I can remove the duplicate value of variant_id when I fetch data on view page.
here is my code for product-view.html file...
<h3>₹ {{product.saleprice}}</h3>
<div class="product-description border-product">
<div class="size-box">
<ul><b>Select Size: </b>
{% for sku in product.skuoption_set.all %}
<li><a href="javascript:void()">{{sku.variantsize}}</a></li>
{% endfor %}
</ul>
</div></div>
what condition i can add here ({% for sku in product.skuoption_set.all %}) or here {{sku.variantsize}}) so that i can remove duplicate values from my view page.
Please have a look in the screenshot, which duplicate value i want to remove.

Here is my `models.py file...
class Size(models.Model):
variant=models.ForeignKey('Variants', related_name='var_size', on_delete=models.CASCADE, null=True, blank=True)
name=models.CharField(max_length=285)
created_at=models.DateTimeField(auto_now_add=True)
updated_at=models.DateTimeField(auto_now=True)
def __str__(self):
return self.name
this is for skuoption table
class SkuOption(models.Model):
product = models.ForeignKey('Product', null=True, blank=True, on_delete=models.CASCADE)
variantflavour=models.ForeignKey('Flavour', related_name='varflavour', on_delete=models.CASCADE, null=True, blank=True)
variantsize=models.ForeignKey('Size', related_name='varsize', on_delete=models.CASCADE, null=True, blank=True)
sku=models.CharField(max_length=285, null=True, blank=True)
price=models.CharField(max_length=285, null=True, blank=True)
qty=models.CharField(max_length=285, null=True, blank=True)
created_at=models.DateTimeField(auto_now_add=True)
updated_at=models.DateTimeField(auto_now=True)
def __str__(self):
return self.sku
distinct():for sku in product.skuoption_set.distinct.all