def setNotaMateria(request,action,alumnoid=0): try: request.get_json() except Exception as identifier: raise BadResquest('Estructura de archivo invalida',CodeInternalError.ERROR_INTERNAL_10_JSON_BAD_FORMED) isValidDataType(request) isValidNotaFinal(request.json['notafinal']) if (action): notamateria=NotaMateria( alumnoid, request.json['nombremateria'], request.json['notafinal'], 0, ADD_NEW ) '''else: try: notamateria=NotaMateria( request.json['alumno_id'], request.json['nombremateria'], request.json['notafinal'], request.json['notamateria_id'], UPDATE ) except Exception as identifier: raise BadResquest('Estructura de archivo invalida',CodeInternalError.ERROR_INTERNAL_10_JSON_BAD_FORMED)''' return notamateria
def setNotaMateria(request): try: notamateria = NotaMateria(request.json['alumno_id'], request.json['nombremateria'], request.json['notafinal']) except Exception as identifier: raise BadResquest('Estructa de Json incorrecta', CodeInternalError.ERROR_INTERNAL_10_JSON_BAD_FORMED) return notamateria
def imprimirJson(): notamateria = NotaMateria('11', 'estadistica', '10') json_data = json.dumps(notamateria) print(json_data) return (json_data)