创建自定义UserInfo表

models.py中

from django.contrib.auth.models import AbstractUser
from django_pandas.managers import DataFrameManager

# Create your models here.


class UserInfo(AbstractUser):
    # 自定义字段和正常在model中定义属性现样
    create_time = models.DateTimeField(auto_now_add=True)
    nid = models.AutoField(primary_key=True)
    telephone = models.CharFiled(max_lenth=11, null=True, nuique=True)

settings.py中

# 自定义用户表
AUTH_USER_MODEL = 'app01.UserInfo'

 

posted @ 2022-09-27 09:07  笑而不语心自闲  阅读(40)  评论(0编辑  收藏  举报