|
|
|
@ -22,9 +22,6 @@ from django.http.multipartparser import MultiPartParser
|
|
|
|
|
@csrf_exempt
|
|
|
|
|
def studnets(request):
|
|
|
|
|
if request.method == "POST":
|
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
=======
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
try:
|
|
|
|
|
request_data = json.loads(request.body)
|
|
|
|
|
print(request_data)
|
|
|
|
@ -41,40 +38,6 @@ def studnets(request):
|
|
|
|
|
return JsonResponse(response)
|
|
|
|
|
except Exception as E:
|
|
|
|
|
return JsonResponse(ResponseUtil.error(E))
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
student = Student()
|
|
|
|
|
student.s_username = request.POST.get("s_username")
|
|
|
|
|
student.s_password = request.POST.get("s_password")
|
|
|
|
|
student.s_name = request.POST.get("s_name")
|
|
|
|
|
student.s_sex = request.POST.get("s_sex")
|
|
|
|
|
student.s_grade = request.POST.get("s_grade")
|
|
|
|
|
|
|
|
|
|
student.s_class_name = request.POST.get("s_class_name")
|
|
|
|
|
student.s_major = request.POST.get("s_major")
|
|
|
|
|
|
|
|
|
|
print(student.sid)
|
|
|
|
|
print(student.to_dict())
|
|
|
|
|
student.s_name = request.POST.get("s_name") or ''
|
|
|
|
|
student.s_sex = request.POST.get("s_sex") or ''
|
|
|
|
|
student.s_grade = request.POST.get("s_grade") or ''
|
|
|
|
|
student.s_class_name = request.POST.get("s_class_name") or ''
|
|
|
|
|
student.s_major = request.POST.get("s_major") or ''
|
|
|
|
|
student.username = request.POST.get("username")
|
|
|
|
|
student.password = request.POST.get("password")
|
|
|
|
|
student.name = request.POST.get("name")
|
|
|
|
|
student.sex = request.POST.get("sex")
|
|
|
|
|
student.grade = request.POST.get("grade")
|
|
|
|
|
student.class_name = request.POST.get("class_name")
|
|
|
|
|
student.major = request.POST.get("major")
|
|
|
|
|
student.sid = request.POST.get("sid")
|
|
|
|
|
student.save()
|
|
|
|
|
response = {"code": 200, "message": "添加成功!", "data": student.to_dict()}
|
|
|
|
|
return JsonResponse(response)
|
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> 1e084d20f30e0b66d5e309a483f87ce5cfe06c39
|
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
elif request.method == "GET":
|
|
|
|
|
sid = request.GET.get('sid')
|
|
|
|
|
s_name = request.GET.get('s_name')
|
|
|
|
@ -155,13 +118,6 @@ def studnets(request):
|
|
|
|
|
xx = str(value).split('-')[0]
|
|
|
|
|
print(xx.split('\r\n'))
|
|
|
|
|
return JsonResponse({'code': 200, 'msg': 'success'}, safe=False)
|
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
=======
|
|
|
|
|
|
|
|
|
|
<<<<<<< Updated upstream
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
|
|
|
|
|
>>>>>>> Stashed changes
|
|
|
|
|
def get_select_course_by_id(request):
|
|
|
|
|
pass
|
|
|
|
|