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',
'teacher',
'course',
<<<<<<< Updated upstream
'Eduadmin',
=======
# 'admin1',
>>>>>>> Stashed changes
]
MIDDLEWARE = [

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