23 lines
895 B
Python
23 lines
895 B
Python
|
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 = '用户表'
|