Compare commits
15 Commits
scl-branch
...
master
Author | SHA1 | Date |
---|---|---|
bettleChen | e943dc92a5 | 1 year ago |
bettleChen | 41e76a2742 | 1 year ago |
bettleChen | b0f0292c62 | 1 year ago |
bettleChen | 08b97276a5 | 1 year ago |
bettleChen | ea6a73aee3 | 1 year ago |
bettleChen | 4785eff591 | 1 year ago |
bettleChen | 37d597cd2f | 1 year ago |
bettleChen | 8daef8924f | 1 year ago |
bettleChen | 4aaf96856c | 1 year ago |
bettleChen | ce596c8c3f | 1 year ago |
bettleChen | 311eb3243f | 1 year ago |
bettleChen | 535a691e56 | 1 year ago |
bettleChen | f3658ac3bc | 1 year ago |
bettleChen | afade783a0 | 1 year ago |
bettleChen | a7f7c27b28 | 1 year ago |
@ -1,3 +1,5 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
def jwt_response_payload_handler(token, user=None, request=None, role=None):
|
|
||||||
|
|
||||||
if user.username:
|
|
||||||
name = user.username
|
|
||||||
else:
|
|
||||||
name = user.username
|
|
||||||
return {
|
|
||||||
"authenticated": True,
|
|
||||||
'id': user.id,
|
|
||||||
"role": role,
|
|
||||||
'name': name,
|
|
||||||
'username': user.username,
|
|
||||||
'token': token,
|
|
||||||
}
|
|
@ -1,3 +1,14 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.core.paginator import Paginator
|
||||||
|
|
||||||
|
from Student.models import Student
|
||||||
|
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
class StudentAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ("username", "password", "name", "sex", "grade", "class_name", "major")
|
||||||
|
list_per_page = 5
|
||||||
|
list_filter = ('sex', 'grade', 'class_name', "major")
|
||||||
|
search_fields = ("name", "sex", "grade", "class_name", "major")
|
||||||
|
|
||||||
|
admin.site.register(Student, StudentAdmin)
|
@ -1,3 +1,45 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from .models import Course, SC
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
|
admin.site.site_header = '教务系统管理端'
|
||||||
|
|
||||||
|
|
||||||
|
class CourseAdmin(admin.ModelAdmin):
|
||||||
|
'''设置列表可显示的字段'''
|
||||||
|
list_display = ('cid', 'name', 'type', 'credit', "tid")
|
||||||
|
|
||||||
|
'''设置过滤选项'''
|
||||||
|
list_filter = ('name', 'credit', 'type')
|
||||||
|
|
||||||
|
'''每页显示条目数'''
|
||||||
|
list_per_page = 5
|
||||||
|
|
||||||
|
'''设置可编辑字段'''
|
||||||
|
list_editable = ('name', 'type', 'credit', "tid")
|
||||||
|
|
||||||
|
'''按发布日期排序'''
|
||||||
|
ordering = ('-credit',)
|
||||||
|
|
||||||
|
search_fields = ('name', 'type', 'credit', "tid")
|
||||||
|
|
||||||
|
|
||||||
|
class ScAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ('student_name', 'course_name', 'middle_grade', 'end_grade')
|
||||||
|
list_per_page = 5
|
||||||
|
|
||||||
|
def student_name(self, obj):
|
||||||
|
print(obj)
|
||||||
|
return obj.sid.name
|
||||||
|
|
||||||
|
def course_name(self, obj):
|
||||||
|
return obj.cid.name
|
||||||
|
|
||||||
|
list_editable = ('middle_grade', "end_grade")
|
||||||
|
|
||||||
|
ordering = ('-end_grade',)
|
||||||
|
|
||||||
|
|
||||||
|
admin.site.register(Course, CourseAdmin)
|
||||||
|
admin.site.register(SC, ScAdmin)
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
.login-module{margin-top:60px;position:absolute;right:500px;text-align:center;width:30%}.el-header{background-color:#b3c0d1;color:#333;line-height:60px}.transfer-footer{margin-left:20px;padding:6px 5px}
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,19 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
|
<link rel="icon" href="/static/favicon.ico">
|
||||||
|
<title>front</title>
|
||||||
|
<script defer="defer" src="/static/js/chunk-vendors.0bcf2d54.js"></script>
|
||||||
|
<script defer="defer" src="/static/js/app.8637dce5.js"></script>
|
||||||
|
<link href="/static/css/chunk-vendors.10dd4e95.css" rel="stylesheet">
|
||||||
|
<link href="/static/css/app.34ccc13b.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript><strong>We're sorry but front doesn't work properly without JavaScript enabled. Please enable it to
|
||||||
|
continue.</strong></noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,3 +1,16 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
from teacher.models import Teacher
|
||||||
|
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
|
|
||||||
|
class TeacherAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ("username", "password", "name", "sex", "title", "education", "dept")
|
||||||
|
list_per_page = 5
|
||||||
|
list_filter = ("sex", "title", "education", "dept")
|
||||||
|
search_fields = ("name", "sex", "title", "education", "dept")
|
||||||
|
|
||||||
|
|
||||||
|
admin.site.register(Teacher, TeacherAdmin)
|
Loading…
Reference in new issue