from django.db import models # Create your models here. class UserBaseInfo(models.Model): id = models.AutoField(verbose_name='用户id', primary_key=True) username = models.CharField(verbose_name='用户名', max_length=30) password = models.CharField(verbose_name='密码', max_length=20) age = models.IntegerField(verbose_name='年龄') mobile = models.CharField(verbose_name='手机号', max_length=20) status = models.CharField(verbose_name='状态', max_length=1) create_date = models.DateField(verbose_name='创建时间', auto_now_add=True) class UserStatus(models.Model): # id = models.AutoField(verbose_name='状态id', primary_key=True) status = models.CharField(verbose_name='状态', max_length=10) class ImgFile(models.Model): name = models.CharField(verbose_name='名称', default='', max_length=30) heading = models.FileField(verbose_name='文件', upload_to='uploads/') def __str__(self): return str(self.name) class Meta: verbose_name = '用户头像信息' db_table = 'user_img'