Suppose I have a Django model with two fields one and two:
class MyModel(models.Model):
one = models.CharField(max_length=100, unique=True)
two = models.CharField(max_length=100)
unique=True
means if I try to put in a row with one="one" when another such row already exists, a unique constraint will be violated.
How would I make a Django constraint that says if there is a row with one="one", then I can't put in a row with two="one"?
This does seem related to this question and this answer, but I don't quite see the answer to my question.