react_mxonline
//users model design
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class UserProfile(AbstractUser):
nick_name = models.CharField(max_length=15, default="", verbose_name="昵称")
birthday = models.DateField(verbose_name="生日", null=True, blank=True)
address = models.CharField(max_length=100, default="", verbose_name="地址")
gender = models.CharField(max_length=6, choices=(("male", "男"), ("female","女")), default="female", verbose_name="性别")
mobile = models.CharField(max_length=11, null=True, blank=True, verbose_name="电话")
image = models.ImageField(upload_to="image/%Y/%m", default="image/default.png", verbose_name="图像")
class Meta:
verbose_name = "用户信息"
verbose_name_plural = verbose_name
def __str__(self):
return self.username