longclaw icon indicating copy to clipboard operation
longclaw copied to clipboard

Product Reviews

Open JamesRamm opened this issue 7 years ago • 1 comments

Product review model & API.

Something along the lines of:


class ProductReview(models.Model):
    product = models.ForeignKey('longclawproducts.Product')
    rating = models.IntegerField(max=5)
    comments = models.CharField(max_length=128)

Couple of question to answer:

  • Should it be related to the Product model or ProductVariant model?
  • Should it be created as a separate app (not within longclaw?). Off the top of my head, pros of separate app are; it is in keeping with django philosophy, it keeps longclaw simple. Cons are; it is only usable if longclaw is installed anyway (cause of the foreign key) & a separate app may make setup of the whole longclaw system a bit more confusing to users?

JamesRamm avatar Apr 07 '17 06:04 JamesRamm

The model of comments is better implemented with the link to the product. Here it is better to use Many-to-one relationships.

Creating a model of comments as a separate application does not make sense. Since comments are required only for one type of interaction with the product.

Do not forget to make the possibility of rating the product. Since not everyone wants to write.

alexfromvl avatar May 15 '17 05:05 alexfromvl