<reponame>JeanFirmino/Ponto-turistico
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Avaliacao(models.Model):
    user = models.ForeignKey( User, on_delete=models.CASCADE)
    comentario = models.TextField( null = True, blank = True)
    nota = models.DecimalField( max_digits = 3, decimal_places = 2)
    data = models.DateTimeField( auto_now_add = True)

    class Meta:
        verbose_name_plural = "Avaliações"

    def __str__(self):
        return self.user.username
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Avaliacao(models.Model):
    user = models.ForeignKey( User, on_delete=models.CASCADE)
    comentario = models.TextField( null = True, blank = True)
    nota = models.DecimalField( max_digits = 3, decimal_places = 2)
    data = models.DateTimeField( auto_now_add = True)

    class Meta:
        verbose_name_plural = "Avaliações"

    def __str__(self):
        return self.user.username
# Create your models here.