Create PercentageField for use in future CBT comp

This commit is contained in:
Kumi 2020-12-31 22:17:46 +01:00
parent 80ab879017
commit 5b4b3058a5

5
common/fields.py Normal file
View file

@ -0,0 +1,5 @@
from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
class PercentageField(models.FloatField):
default_validators = [MaxValueValidator(100), MinValueValidator(0)]