Hi actually i new to django Restframe work. Here i have mentioned my model My question is that ? I don't know how to store the count of each product. and most viewed product should display in frontend.
MODEL.PY
class Products(models.Model):
name = models.CharField(max_length=100)
image = models.CharField(max_length=10, null=True)
categories = models.ArrayModelField(
model_container=Category,
model_form_class=CategoryForm
)
specifications = models.ArrayModelField(
model_container=Specifications,
model_form_class=SpecificationsForm
)
description = models.CharField(max_length=500)
reviews = models.ArrayModelField(
model_container=Reviews,
model_form_class=ReviewsForm
)
drizzly = models.BooleanField(default=False)
complete = models.BooleanField(default=False)
comment = models.CharField(max_length=500)
count = models.IntegerField()