from django.db import models class Students(models.Model): """ 学生信息表 """ sid = models.CharField(verbose_name="学号", max_length=10, unique=True) name = models.CharField(verbose_name="姓名", max_length=10) score = models.DecimalField(verbose_name="积分", max_digits=5, decimal_places=1, default=0) # signin = models.IntegerField(verbose_name="签到次数", default=0) # absences = models.IntegerField(verbose_name="缺席次数", default=0) class Pledge(models.Model): """ 典当信息表 """ pledge_score = models.IntegerField() # 典当的积分 status = models.IntegerField(default=0) # 典当状态,0 表示未完成 created_at = models.DateTimeField(auto_now_add=True) # 自动设置为当前时间 student_id = models.CharField(max_length=10) # 学号 student_name = models.CharField(max_length=10) # 姓名