多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
>[success] # models 配置 ~~~ 1.choices/default 选择默认值 2.verbose_name 字段名字 3.class Meta: verbose_name = verbose_name_plural = "学员信息" ~~~ ~~~ from django.db import models # Create your models here. class Student(models.Model): SEX_ITEMS = [ (1, '男'), (2, '女'), (0, '未知'), ] STATUS_ITEMS = [ (0, "申请"), (1, "通过"), (2, "拒绝"), ] name = models.CharField(max_length=128, verbose_name="姓名") sex = models.IntegerField(choices=SEX_ITEMS, verbose_name="性别", default=1) profession = models.CharField(max_length=128, verbose_name="职业") email = models.EmailField(verbose_name="邮箱") qq = models.SmallIntegerField(verbose_name="QQ") phone = models.CharField(max_length=128,verbose_name="电话") status = models.IntegerField(choices=STATUS_ITEMS, verbose_name="审核状态") created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") def __str__(self): return self.name class Meta: verbose_name = verbose_name_plural = "学员信息" ~~~