models.py 534 B

123456789101112131415
  1. import uuid
  2. from django.contrib.auth.models import AbstractUser
  3. from django.db import models
  4. class CustomUser(AbstractUser):
  5. _id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
  6. name = models.CharField("name",max_length=50,default="-")
  7. nick = models.CharField("nick",max_length=50,default="-")
  8. avatar = models.ForeignKey('goods.Image', null = True, on_delete=models.CASCADE)
  9. login = models.CharField("login",max_length=50,default="-")
  10. def __str__(self):
  11. return self.username