From deab8404003776261b59fe32b47d76131fd53b7f Mon Sep 17 00:00:00 2001 From: jisyoona <664501563@qq.com> Date: Wed, 6 Sep 2023 13:47:40 +0800 Subject: [PATCH] update student models code --- EduSystemServer/Student/models.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/EduSystemServer/Student/models.py b/EduSystemServer/Student/models.py index b4ab37d..765a860 100644 --- a/EduSystemServer/Student/models.py +++ b/EduSystemServer/Student/models.py @@ -3,4 +3,16 @@ from django.db import models # Create your models here. class Student(models.Model): - sid = models.AutoField(primary_key=True, verbose_name="学生编号") + sid = models.IntegerField(primary_key=True, verbose_name="学生编号", name="sid") + username = models.CharField(max_length=30, verbose_name="用户名称", name="s_username") + password = models.CharField(max_length=100, verbose_name="密码", name="s_password") + s_name = models.CharField(max_length=100, verbose_name="姓名", name="s_name") + sex = models.CharField(max_length=4, verbose_name="性别", name="s_sex") + grade = models.IntegerField(verbose_name="年级", name="s_grade") + class_name = models.CharField(max_length=50, verbose_name="班级", name="s_class_name") + major = models.CharField(max_length=50, verbose_name="专业名称", name="s_major") + + class Meta: + db_table = "student" + verbose_name = "学生" + verbose_name_plural = verbose_name