Create PercentageField for use in future CBT comp
This commit is contained in:
parent
6f272defe8
commit
9dc5e1bfd6
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