kumify/common/fields.py

5 lines
No EOL
215 B
Python

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