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.

25 lines
784 B

2 months ago
from django.db import models
# Create your models here.
class StudentInfo(models.Model):
stu_id = models.CharField(primary_key=True, max_length=20)
stu_name = models.CharField(max_length=20)
stu_pwd = models.CharField(max_length=20)
# -----
from django.db import models
# 学生表
class Student(models.Model):
name = models.CharField(max_length=100)
student_id = models.CharField(max_length=100, unique=True) # 学号设为唯一
score = models.FloatField(default=0) # 积分允许为小数
attendance_count = models.IntegerField(default=0) # 到课次数
2 months ago
called_count = models.IntegerField(default=0) # 被点名次数
protected = models.BooleanField(default=False) # 是否有保护权
2 months ago
def __str__(self):
return self.name