model
作者:互联网
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")
标签:verbose,models,MinValueValidator,MaxValueValidator,validators,import,model 来源: https://www.cnblogs.com/li-gao-wang/p/15239286.html