MinValueValidator,MaxValueValidator
from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
...
size = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(5)])
PositiveSmallIntegerField
max_attendees = models.PositiveSmallIntegerField(verbose_name="取值范围0~3W+" )
PositiveIntegerField
max_num = models.PositiveIntegerField(verbose_name=" 取值范围 0~2147483647")