Create PercentageField for use in future CBT comp

This commit is contained in:
Kumi 2020-12-31 22:17:46 +01:00
parent 6f272defe8
commit 9dc5e1bfd6

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)]