About Minimal and Maximal Values for Numeric Fields
You can set the minimal and maximal values for a numeric field using Django validators:
from django.db import models
from django.core.validators import (
MinValueValidator, MaxValueValidator
)
class Process(models.Model):
progress = models.IntegerField(
validators = [
MinValueValidator(0),
MaxValueValidator(100)
]
)
Tips and Tricks Programming Architecture Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You