update adminapp name

scl-branch
bettleChen 1 year ago
parent a9bb902700
commit f2737ecced

@ -1,7 +1,7 @@
""" """
Django settings for EduSystemServer project. Django settings for EduSystemServer project.
Generated by 'django-admin startproject' using Django 2.2. Generated by 'django-Eduadmin startproject' using Django 2.2.
For more information on this file, see For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/ https://docs.djangoproject.com/en/2.2/topics/settings/
@ -41,7 +41,7 @@ INSTALLED_APPS = [
'Student', 'Student',
'teacher', 'teacher',
'course', 'course',
'admin', 'Eduadmin',
] ]
MIDDLEWARE = [ MIDDLEWARE = [

@ -19,6 +19,6 @@ from django.urls import path, include
import API.urls import API.urls
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('Eduadmin/', admin.site.urls),
path('api/', include(("API.urls", "api"), namespace="api")), path('api/', include(("API.urls", "api"), namespace="api")),
] ]

@ -2,4 +2,4 @@ from django.apps import AppConfig
class AdminConfig(AppConfig): class AdminConfig(AppConfig):
name = 'admin' name = 'Eduadmin'

@ -0,0 +1,12 @@
from django.db import models
# Create your models here.
class Admin(models.Model):
username = models.CharField(max_length=32, primary_key=True, name="username", verbose_name="管理员账号")
password = models.CharField(max_length=128, name="password", verbose_name="管理员密码")
class Meta:
db_table = "Eduadmin"
verbose_name = "管理员"

@ -1,13 +0,0 @@
from django.db import models
# Create your models here.
class Admin(models.Model):
aid = models.AutoField(primary_key=True, name="aid")
username = models.CharField(unique=True, name="username", verbose_name="管理员账号")
password = models.CharField(name="password", verbose_name="管理员密码")
class Meta:
db_table = "admin"
verbose_name = "管理员"

@ -1,5 +1,7 @@
from django.db import models from django.db import models
import Student.models
# Create your models here. # Create your models here.
class Course(models.Model): class Course(models.Model):
@ -16,12 +18,13 @@ class Course(models.Model):
class SC(models.Model): class SC(models.Model):
sid = models.ForeignKey(to="Student", to_field="sid", on_delete=models.CASCADE, name="sid") sid = models.ForeignKey(to=Student.models.Student, to_field="sid", on_delete=models.CASCADE, name="sid")
cid = models.ForeignKey(to="Course", to_field="cid", on_delete=models.CASCADE, name="cid") cid = models.ForeignKey(to=Course.cid, 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 = "admin" db_table = "Eduadmin"
verbose_name = "管理员" verbose_name = "管理员"
verbose_name_plural = verbose_name verbose_name_plural = verbose_name
unique_together = ("sid", "cid")
Loading…
Cancel
Save