You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.9 KiB
46 lines
1.9 KiB
from django.db import models
|
|
|
|
|
|
# Create your models here.
|
|
class Teacher(models.Model):
|
|
tid = models.AutoField(primary_key=True, verbose_name="教师编号", name="tid")
|
|
<<<<<<< Updated upstream
|
|
=======
|
|
<<<<<<< Updated upstream
|
|
username = models.CharField(max_length=128, verbose_name="用户名", name="username", blank=True, unique=True)
|
|
password = models.CharField(max_length=128, verbose_name="密码", name="password", blank=True)
|
|
=======
|
|
>>>>>>> Stashed changes
|
|
>>>>>>> Stashed changes
|
|
name = models.CharField(max_length=255, verbose_name="教师名称", name="name", blank=True)
|
|
sex = models.CharField(max_length=128, verbose_name="教师性别", name="sex", blank=True)
|
|
title = models.CharField(max_length=128, verbose_name="教师职称", name="title", blank=True)
|
|
education = models.CharField(max_length=128, verbose_name="教师学历", name="education", blank=True)
|
|
dept = models.CharField(max_length=128, verbose_name="教师所属院系", name="dept", blank=True)
|
|
<<<<<<< Updated upstream
|
|
=======
|
|
|
|
<<<<<<< Updated upstream
|
|
=======
|
|
def to_dict(self):
|
|
return {"tid": self.tid, "name": self.name, "sex": self.sex,
|
|
"title": self.title, "education": self.education, "dept": self.dept}
|
|
>>>>>>> Stashed changes
|
|
|
|
<<<<<<< HEAD
|
|
def to_dict(self):
|
|
return {"tid": self.tid, "name": self.name, "sex": self.sex,
|
|
"title": self.title, "education": self.education,
|
|
"dept": self.dept, "username": self.username, "password": self.password}
|
|
=======
|
|
>>>>>>> 1e084d20f30e0b66d5e309a483f87ce5cfe06c39
|
|
>>>>>>> Stashed changes
|
|
|
|
def to_dict(self):
|
|
return {"tid": self.tid, "name": self.name, "sex": self.sex, "title": self.title,
|
|
"education": self.education, "dept": self.dept}
|
|
class Meta:
|
|
db_table = "teacher"
|
|
verbose_name = "教师"
|
|
verbose_name_plural = verbose_name
|