[Answer]-How to enforce that only a single object, out of all objects, of a Model has a specified value for a field

1👍

UNIQUE constraint works for both True and False values. If you really want to use it you have to make the is_active field nullable and use None (NULL) instead of False, as two NULLs are not considered equal (at least in PostgreSQL and MySQL).

0👍

Yes, use the ‘unique’ field option in the model definition https://docs.djangoproject.com/en/dev/ref/models/fields/#unique

Leave a comment