Example #1
0
    def handle_change_userpassword(self, request):

        self.app_logger.debug("handle_change_userpassword")

        self.checkMandatoryParams(request, ['oldpassword', 'newpassword'])

        param_dict = request.param_dict

        ret = Student.changePasswordByStudent(request.user.id,
                                              param_dict['oldpassword'],
                                              param_dict['newpassword'])

        return JsonResponse(ret)
Example #2
0
    def handle_get_classstudent_checkins(self, request):
        self.checkMandatoryParams(request, ['traininggrade_id', 'checkinlist'])
        classid = request.param_dict['traininggrade_id']
        # 该课全体学生签到名单
        lessonCheckinlist = json.loads(request.param_dict['checkinlist'])
        sidOfCheckin = [one['student__id'] for one in lessonCheckinlist]
        cStudents = Student.getOneClassStudent(classid)
        for one in cStudents:
            if one['id'] in sidOfCheckin:
                one['ci'] = True
            else:
                one['ci'] = False

        return JsonResponse({'retcode': 0, 'retlist': cStudents})
Example #3
0
 def handle_list_student(self, request):
     self.checkMandatoryParams(request, ['pagenum', 'pagesize'])
     pagenum = int(request.param_dict['pagenum'])
     pagesize = int(request.param_dict['pagesize'])
     return JsonResponse(Student.list(pagenum, pagesize,
                                      request.param_dict))
Example #4
0
 def handle_delete_student(self, request):
     self.checkMandatoryParams(request, ['id'])
     return JsonResponse(Student.deleteOne(request.param_dict['id']))
Example #5
0
 def handle_modify_student(self, request):
     self.checkMandatoryParams(request, ['id', 'newdata'])
     newData = json.loads(request.param_dict['newdata'])
     return JsonResponse(Student.modify(request.param_dict['id'], newData))
Example #6
0
 def handle_add_student(self, request):
     self.checkMandatoryParams(request, ['data'])
     data = json.loads(request.param_dict['data'])
     return JsonResponse(Student.add(data))
Example #7
0
    def handle_get_my_clessons(self, request):

        studentid = request.session['studentid']
        ret = Student.getstudentcheckinlessons(studentid)

        return JsonResponse(ret)
Example #8
0
    def handle_get_my_info(self, request):

        studentid = request.session['studentid']
        ret = Student.getone(studentid)

        return JsonResponse(ret)