from django.db import models
from django.contrib.auth import get_user_model
from django.utils import timezone
User = get_user_model()
from product.models import Product
# from datetime import datetime


class Review(models.Model):
    user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
    product = models.ForeignKey(Product, on_delete=models.CASCADE)
    rating = models.DecimalField(max_digits=2, decimal_places=1)
    comment = models.TextField()
    date_created = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.comment


95f0520c49c65e133a74ae1a5398772b1de5f249
<mask token>


class Review(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __str__(self):
        return self.comment

<mask token>


class Review(models.Model):
    user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
    product = models.ForeignKey(Product, on_delete=models.CASCADE)
    rating = models.DecimalField(max_digits=2, decimal_places=1)
    comment = models.TextField()
    date_created = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.comment

<mask token>
User = get_user_model()
<mask token>


class Review(models.Model):
    user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
    product = models.ForeignKey(Product, on_delete=models.CASCADE)
    rating = models.DecimalField(max_digits=2, decimal_places=1)
    comment = models.TextField()
    date_created = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.comment

from django.db import models
from django.contrib.auth import get_user_model
from django.utils import timezone
User = get_user_model()
from product.models import Product


class Review(models.Model):
    user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
    product = models.ForeignKey(Product, on_delete=models.CASCADE)
    rating = models.DecimalField(max_digits=2, decimal_places=1)
    comment = models.TextField()
    date_created = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.comment

from django.db import models
from django.contrib.auth import get_user_model
from django.utils import timezone
User = get_user_model()
from product.models import Product
# from datetime import datetime


class Review(models.Model):
    user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
    product = models.ForeignKey(Product, on_delete=models.CASCADE)
    rating = models.DecimalField(max_digits=2, decimal_places=1)
    comment = models.TextField()
    date_created = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return self.comment

