Create PercentageField for use in future CBT comp
This commit is contained in:
parent
80ab879017
commit
5b4b3058a5
1 changed files with 5 additions and 0 deletions
5
common/fields.py
Normal file
5
common/fields.py
Normal 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)]
|
Loading…
Reference in a new issue