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.

16 lines
646 B

from django.db import models
# Create your models here.
#用户表
class user(models.Model):
username = models.CharField(max_length=200,unique=True)
password = models.CharField(max_length=200)
#学生表
class student(models.Model):
student_xuehao=models.IntegerField(default=0)
student_name = models.CharField(max_length=200,null=True, blank=True)
student_major = models.CharField(max_length=200,null=True, blank=True)
student_class = models.CharField(max_length=200,null=True, blank=True)
student_score = models.FloatField(default=0)
teather=models.ForeignKey(to='user',to_field='id',on_delete=models.CASCADE)