scl-branch
bettleChen 1 year ago
parent deab840400
commit 5f7c949e9b

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="edu_sys@localhost" uuid="fc67d607-329d-4381-af5b-a0e372257c56">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306/edu_sys</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

@ -41,11 +41,7 @@ INSTALLED_APPS = [
'Student', 'Student',
'teacher', 'teacher',
'course', 'course',
<<<<<<< Updated upstream
'Eduadmin', 'Eduadmin',
=======
# 'admin1',
>>>>>>> Stashed changes
] ]
MIDDLEWARE = [ MIDDLEWARE = [

@ -1,6 +1,7 @@
from django.db import models from django.db import models
import Student.models from teacher.models import Teacher
from Student.models import Student
# Create your models here. # Create your models here.
@ -9,7 +10,7 @@ class Course(models.Model):
c_name = models.CharField(max_length=255, verbose_name="课程名称", name="c_name") c_name = models.CharField(max_length=255, verbose_name="课程名称", name="c_name")
type = models.CharField(max_length=128, verbose_name="课程类型", name="c_type") type = models.CharField(max_length=128, verbose_name="课程类型", name="c_type")
credit = models.IntegerField(verbose_name="课程学分", name="credit") credit = models.IntegerField(verbose_name="课程学分", name="credit")
tid = models.ForeignKey(to="teacher", to_field="tid", on_delete=models.CASCADE, name="tid") tid = models.ForeignKey(Teacher, to_field="tid", on_delete=models.CASCADE, name="tid")
class Meta: class Meta:
db_table = "course" db_table = "course"
@ -18,13 +19,13 @@ class Course(models.Model):
class SC(models.Model): class SC(models.Model):
sid = models.ForeignKey(to=Student.models.Student, to_field="sid", on_delete=models.CASCADE, name="sid") sid = models.ForeignKey(Student, to_field="sid", on_delete=models.CASCADE, name="sid")
cid = models.ForeignKey(to=Course.cid, to_field="cid", on_delete=models.CASCADE, name="cid") cid = models.ForeignKey(Course, to_field="cid", on_delete=models.CASCADE, name="cid")
middle_grade = models.IntegerField(name="middle_grade") middle_grade = models.IntegerField(name="middle_grade")
end_grade = models.IntegerField(name="end_grade") end_grade = models.IntegerField(name="end_grade")
class Meta: class Meta:
db_table = "Eduadmin" db_table = "sc"
verbose_name = "管理员" verbose_name = "管理员"
verbose_name_plural = verbose_name verbose_name_plural = verbose_name
unique_together = ("sid", "cid") unique_together = ("sid", "cid")
Loading…
Cancel
Save