Django has various numeric fields available for use in models, e.g. DecimalField and PositiveIntegerField. Although the former can be restricted to the number of decimal pla
from django.db import models from django.core.validators import MinValueValidator, MaxValueValidator size = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(5)])