|
|
@ -4,38 +4,6 @@ from django.db import models
|
|
|
|
# Create your models here.
|
|
|
|
# Create your models here.
|
|
|
|
class Student(models.Model):
|
|
|
|
class Student(models.Model):
|
|
|
|
sid = models.AutoField(primary_key=True, verbose_name="学生编号", name="sid")
|
|
|
|
sid = models.AutoField(primary_key=True, verbose_name="学生编号", name="sid")
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
|
|
|
s_username = models.CharField(max_length=30, verbose_name="用户名称", name="s_username", blank=True)
|
|
|
|
|
|
|
|
s_password = models.CharField(max_length=100, verbose_name="密码", name="s_password", blank=True)
|
|
|
|
|
|
|
|
s_name = models.CharField(max_length=100, verbose_name="姓名", name="s_name", blank=True)
|
|
|
|
|
|
|
|
s_sex = models.CharField(max_length=4, verbose_name="性别", name="s_sex", blank=True)
|
|
|
|
|
|
|
|
s_grade = models.CharField(max_length=20, verbose_name="年级", name="s_grade", blank=True)
|
|
|
|
|
|
|
|
s_class_name = models.CharField(max_length=50, verbose_name="班级", name="s_class_name", blank=True)
|
|
|
|
|
|
|
|
s_major = models.CharField(max_length=50, verbose_name="专业名称", name="s_major", blank=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def to_dict(self):
|
|
|
|
|
|
|
|
return {"sid": self.sid, "s_name": self.s_name, "s_username": self.s_username, "s_password": self.s_password,
|
|
|
|
|
|
|
|
"s_sex": self.s_sex, "s_grade": self.s_grade, "class_name": self.s_class_name, "s_major": self.s_major}
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
username = models.CharField(max_length=30, verbose_name="用户名称", name="username", blank=True)
|
|
|
|
|
|
|
|
password = models.CharField(max_length=100, verbose_name="密码", name="password", blank=True)
|
|
|
|
|
|
|
|
name = models.CharField(max_length=100, verbose_name="姓名", name="name", blank=True)
|
|
|
|
|
|
|
|
sex = models.CharField(max_length=4, verbose_name="性别", name="sex", blank=True)
|
|
|
|
|
|
|
|
grade = models.CharField(max_length=20, verbose_name="年级", name="grade", blank=True)
|
|
|
|
|
|
|
|
class_name = models.CharField(max_length=50, verbose_name="班级", name="class_name", blank=True)
|
|
|
|
|
|
|
|
major = models.CharField(max_length=50, verbose_name="专业名称", name="major", blank=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def to_dict(self):
|
|
|
|
|
|
|
|
return {"sid": self.sid, "name": self.name, "username": self.username, "password": self.password,
|
|
|
|
|
|
|
|
"sex": self.sex, "grade": self.grade, "class_name": self.class_name, "major": self.major}
|
|
|
|
|
|
|
|
>>>>>>> 7b09141c358f80dd8877b8665d0d55b629db72aa
|
|
|
|
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
username = models.CharField(max_length=30, verbose_name="用户名称", name="username", blank=True)
|
|
|
|
username = models.CharField(max_length=30, verbose_name="用户名称", name="username", blank=True)
|
|
|
|
password = models.CharField(max_length=100, verbose_name="密码", name="password", blank=True)
|
|
|
|
password = models.CharField(max_length=100, verbose_name="密码", name="password", blank=True)
|
|
|
|
name = models.CharField(max_length=100, verbose_name="姓名", name="name", blank=True)
|
|
|
|
name = models.CharField(max_length=100, verbose_name="姓名", name="name", blank=True)
|
|
|
@ -47,8 +15,6 @@ class Student(models.Model):
|
|
|
|
def to_dict(self):
|
|
|
|
def to_dict(self):
|
|
|
|
return {"sid": self.sid, "name": self.name, "username": self.username, "password": self.password,
|
|
|
|
return {"sid": self.sid, "name": self.name, "username": self.username, "password": self.password,
|
|
|
|
"sex": self.sex, "grade": self.grade, "class_name": self.class_name, "major": self.major}
|
|
|
|
"sex": self.sex, "grade": self.grade, "class_name": self.class_name, "major": self.major}
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
class Meta:
|
|
|
|
db_table = "student"
|
|
|
|
db_table = "student"
|
|
|
|