def get(self, request, *args, **kwargs): try: hour_activity_service = HourActivityService() result = hour_activity_service.get() return JsonResponse(encode.to_json( Response(datos=result)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def get(self, request, *args, **kwargs): try: semester_number_service = SemesterNumberService() result = semester_number_service.get() return JsonResponse(encode.to_json( Response(datos=result)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def get(self, request, *args, **kwargs): try: teacher_service = TeacherService() id_departamento = request.session.get('id_departamento', False) if id_departamento is False: id_departamento = 0 result = teacher_service.obtener_x_departamento(id_departamento) return JsonResponse(encode.to_json( Response(datos=result)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def get(self, request, *args, **kwargs): try: departament_service = DepartamentService() result = departament_service.get() return JsonResponse(encode.to_json(Response(datos=result)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def get(self, request, *args, **kwargs): try: course_service = CourseService() id_plan_estudio = request.session.get('id_plan_estudio', False) if id_plan_estudio is False: id_plan_estudio = 0 result = course_service.obtener_x_plan_estudio(id_plan_estudio) return JsonResponse(encode.to_json(Response(datos=result)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def delete(self, request, *args, **kwargs): try: teacher_service = TeacherService() teacher_dto = TeacherDto() teacher_dto.from_json(request.GET) teacher_service.delete(teacher_dto) return JsonResponse(encode.to_json( Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def get(self, request, *args, **kwargs): try: carga_efectiva_service = CargaEfectivaService() username = request.session.get('username', False) if username is False: username = None result = carga_efectiva_service.get(username) return JsonResponse(encode.to_json(Response(datos=result)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def delete(self, request, *args, **kwargs): try: hour_activity_service = HourActivityService() hour_activity_dto = HourActivityDto() hour_activity_dto.from_json(request.GET) hour_activity_service.delete(hour_activity_dto) return JsonResponse(encode.to_json( Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def delete(self, request, *args, **kwargs): try: category_service = CategoryService() category_dto = CategoryDto() category_dto.from_json(request.GET) category_service.delete(category_dto) return JsonResponse(encode.to_json(Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def post(self, request, *args, **kwargs): try: hour_activity_service = HourActivityService() hour_activity_dto = HourActivityDto() json_data = encode.to_json_object(request.body) hour_activity_dto.from_json(json_data) hour_activity_service.save(hour_activity_dto) return JsonResponse(encode.to_json( Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def delete(self, request, *args, **kwargs): try: departament_service = DepartamentService() departament_dto = DepartamentDto() departament_dto.from_json(request.GET) departament_service.delete(departament_dto) return JsonResponse(encode.to_json(Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def delete(self, request, *args, **kwargs): try: study_plan_service = StudyPlanService() study_plan_dto = StudyPlanDto() study_plan_dto.from_json(request.GET) study_plan_service.delete(study_plan_dto) return JsonResponse(encode.to_json(Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def post(self, request, *args, **kwargs): try: semester_number_service = SemesterNumberService() semester_number_dto = SemesterNumberDto() json_data = encode.to_json_object(request.body) semester_number_dto.from_json(json_data) semester_number_service.save(semester_number_dto) return JsonResponse(encode.to_json( Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def delete(self, request, *args, **kwargs): try: semester_type_service = SemesterTypeService() semester_type_dto = SemesterTypeDto() semester_type_dto.from_json(request.GET) semester_type_service.delete(semester_type_dto) return JsonResponse(encode.to_json(Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def post(self, request, *args, **kwargs): try: departament_service = DepartamentService() departament_dto = DepartamentDto() json_data = encode.to_json_object(request.body) departament_dto.from_json(json_data) departament_service.save(departament_dto) return JsonResponse(encode.to_json(Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def post(self, request, *args, **kwargs): try: category_service = CategoryService() category_dto = CategoryDto() json_data = encode.to_json_object(request.body) category_dto.from_json(json_data) category_service.save(category_dto) return JsonResponse(encode.to_json(Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def post(self, request, *args, **kwargs): try: teacher_service = TeacherService() teacher_dto = TeacherDto() id_departamento = request.session.get('id_departamento', False) if id_departamento is False: id_departamento = 0 json_data = encode.to_json_object(request.body) teacher_dto.from_json(json_data) teacher_dto.IdDepartament = id_departamento teacher_service.save(teacher_dto) return JsonResponse(encode.to_json( Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)
def post(self, request, *args, **kwargs): try: course_service = CourseService() course_dto = CourseDto() id_plan_estudio = request.session.get('id_plan_estudio', False) if id_plan_estudio is False: id_plan_estudio = 0 json_data = encode.to_json_object(request.body) course_dto.from_json(json_data) course_dto.IdPlanEstudio = id_plan_estudio course_service.save(course_dto) return JsonResponse(encode.to_json(Response(datos=True)), safe=False) except Exception as e: return JsonResponse(encode.to_json( Response(estado=False, mensaje=str(e))), safe=False)