class User(AbstractUser): user_id = models.UUIDField(default=uuid.uuid4, primary_key=True, unique=True, editable=False)
class Meta:
ordering = ['username']
verbose_name_plural = 'User'
class Profile(models.Model):
GENDER = (('m','Male'), ('f','Female'))
user = models.OneToOneField(User, on_delete=models.CASCADE)
gender = models.CharField(max_length=1, choices=GENDER)
phone = models.CharField(max_length=11, blank=True, null=True)
country = CountryField()
address = models.TextField()
image = models.ImageField(default='default.jpeg', upload_to='profile_pics')
blood_group = models.ForeignKey(UserGroup, default=1, on_delete=models.CASCADE)
def __str__(self):
return f'{self.user.username} ({self.user.email})'
when i run python manage.py migrate the bellow error pops up
Aucun commentaire:
Enregistrer un commentaire