You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
466 B

from django.db import models
from django.core import validators
from content.models import Content
from django.contrib.auth.models import Group, User
class Vote(models.Model):
votant = models.ForeignKey(User, on_delete=models.CASCADE)
content = models.ForeignKey(Content, on_delete=models.CASCADE)
vote = models.IntegerField(
validators=[
validators.MaxValueValidator(5),
validators.MinValueValidator(0)
]
)