https://docs.djangoproject.com/en/4.0/ref/models/constraints/
Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate Documentation Search: Search Getting Help el es fr id it ja ko pl pt-br zh-hans Language: en 2.2 3.0 3.1 3.2 dev Documentation version: 4.0 ¶ The classes defined in this module create database constraints. They are added in the model Meta.constraints option. Referencing built-in constraints Constraints are defined in django.db.models.constraints , but for convenience they’re imported into django.db.models . The standard convention is to use from django.db import models and refer to the constraints as models.<Foo>Constraint . Constraints in abstract base classes You must always specify a unique name for the constraint. As such, you cannot normally specify...