|
|
@ -16,6 +16,9 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
|
|
|
@csrf_exempt
|
|
|
|
@csrf_exempt
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
def add_student(request):
|
|
|
|
def add_student(request):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
添加学生
|
|
|
|
|
|
|
|
"""
|
|
|
|
if not request.method == "POST":
|
|
|
|
if not request.method == "POST":
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -37,6 +40,9 @@ def add_student(request):
|
|
|
|
@csrf_exempt
|
|
|
|
@csrf_exempt
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
def search_student(request):
|
|
|
|
def search_student(request):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
根据表单对学生进行模糊查询,以及将查询的数据进行分页
|
|
|
|
|
|
|
|
"""
|
|
|
|
currentPage = request.GET.get("currentPage")
|
|
|
|
currentPage = request.GET.get("currentPage")
|
|
|
|
pageSize = request.GET.get("pageSize")
|
|
|
|
pageSize = request.GET.get("pageSize")
|
|
|
|
request_data = request.POST
|
|
|
|
request_data = request.POST
|
|
|
@ -67,6 +73,9 @@ def search_student(request):
|
|
|
|
@csrf_exempt
|
|
|
|
@csrf_exempt
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
@permission(allowed_roles=["admin", "teacher"])
|
|
|
|
def del_student(request):
|
|
|
|
def del_student(request):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
根据学生ID删除学生
|
|
|
|
|
|
|
|
"""
|
|
|
|
if not request.method == "GET":
|
|
|
|
if not request.method == "GET":
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -82,6 +91,9 @@ def del_student(request):
|
|
|
|
@csrf_exempt
|
|
|
|
@csrf_exempt
|
|
|
|
@permission(allowed_roles=["admin", "student", "teacher"])
|
|
|
|
@permission(allowed_roles=["admin", "student", "teacher"])
|
|
|
|
def select_course(request):
|
|
|
|
def select_course(request):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
选课
|
|
|
|
|
|
|
|
"""
|
|
|
|
if not request.method == "POST":
|
|
|
|
if not request.method == "POST":
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
return JsonResponse(ResponseUtil.error("request method error!"))
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|