mirror of
https://github.com/Sosokker/ku-polls.git
synced 2025-12-18 21:14:05 +01:00
Check vote score. Vote score can only be 0 or positive
This commit is contained in:
parent
215be4d95c
commit
32605720fc
@ -14,6 +14,7 @@ import datetime
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.contrib import admin
|
||||
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||
|
||||
|
||||
class Question(models.Model):
|
||||
@ -90,7 +91,7 @@ class Choice(models.Model):
|
||||
|
||||
question = models.ForeignKey(Question, on_delete=models.CASCADE)
|
||||
choice_text = models.CharField(max_length=200)
|
||||
votes = models.IntegerField(default=0)
|
||||
votes = models.PositiveIntegerField(default=0, validators=[MinValueValidator(0), MaxValueValidator(2147483647)])
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user