1from django.db import models
2from django.core.validators import MaxValueValidator, MinValueValidator
3
4class MyModel(models.Model):
5 qty = models.IntegerField(
6 default=1,
7 validators=[MaxValueValidator(100), MinValueValidator(1)]
8 )
9