CMS_Django_Backend/apps/auth/models.py

23 lines
895 B
Python
Raw Normal View History

2024-08-18 20:51:27 +08:00
from django.db import models
# Create your models here.
class User(models.Model):
"""
用户表
"""
id = models.AutoField(verbose_name="id", primary_key=True, unique=True)
username = models.CharField(max_length=50, unique=True, verbose_name="用户名", null=True, blank=True)
pwd = models.CharField(max_length=1000, verbose_name="密码", null=True, blank=True)
email = models.CharField(max_length=100, verbose_name="电子邮件")
phone = models.CharField(max_length=11, verbose_name="手机", null=True, blank=True)
create_time = models.DateTimeField(verbose_name="注册时间")
avatar = models.ImageField(verbose_name="头像")
last_login_time = models.DateTimeField(verbose_name="最后登录时间", auto_now=True)
def __str__(self):
return self.username
class Meta:
verbose_name = '用户表'