A
A
AKurmazov2017-08-05 09:32:05
Django
AKurmazov, 2017-08-05 09:32:05

How to make unique email unless email field is empty in Django?

How can you make an email field unique if there is something in it? That is, I do not need to check this field for uniqueness if email == "".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2017-08-05
@AKurmazov

A separate emails table, then from the Users table you can set a Foreign key with the possibility of NULL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question