I would like to know if there is any conflict using the constraint unique_together
as well as the parameter unique=true
in one of the fields that belong to the array of the unique_together
.
I can´t remove the parameter unique=true
of my field because it´s used as a the foreign key in another model.
class User(AbstractUser):
# User information
fiscal_number = models.CharField(max_length=30,unique=True)
phone = models.CharField(max_length=15, null=True)
email = models.EmailField(max_length=254, verbose_name='email address')
class Meta:
unique_together = ['fiscal_number', 'email']
As you can see the goal is to make the combination of the fields fiscal_number
and email
unique.