class User(AbstractUser):
mobile = models.CharField(max_length=16, unique=True)
avatar = models.ImageField(upload_to='avatar', default='avatar/default.png') # ImageField继承自filefield需要pillow模块的支持
class Meta:
db_table = 'nav_user' # 指定表名
verbose_name = '用户表' # 在后台管理中看到的中文
verbose_name_plural = verbose_name #
def __str__(self): # 打印对象显示出来的
return self.username
标签:__,配置,verbose,models,模型,常见,avatar,self,name From: https://www.cnblogs.com/abc683871/p/17567789.html