标签:import strong rom app mode col play info field
from django.contrib.auth.models import AbstractUser
在Settings 中 加入
AUTH_USER_MODEL = ‘myapp.UserInfo‘
即‘app.类名‘
在 manage.py task 中 makemigrations 之后 migration
class UserInfo(AbstractUser):
tel = models.CharField(max_length=32)
gender = models.IntegerField(choices=((1, "男"), (1, "女"),), default=1)
user = UserInfo.objects.get(pk=‘1‘)
user.get_gender_display()
标签:import strong rom app mode col play info field
原文地址:https://www.cnblogs.com/ls1997/p/11135383.html