def get_count_ejercicios_categoria_kid(id_kid): dao = Ejercicio_KidDAO() date = datetime.strftime(datetime.min, DAOs.date_format) date = '01-01-2000' ejercicios = dao.get_by_kid_week(id_kid, date) count = contar_ejercicios_por_categoria(ejercicios) return jsonify(count)
def get_recommended_kid(id_kid): dao = Ejercicio_KidDAO() ejer_dao = EjercicioDAO() # date = datetime.strftime(datetime.min, DAOs.date_format) date = '01-01-2000' ejercicios = dao.get_by_kid_week(id_kid, date) count, avg = ejercicios_por_ejercicio_promedio(ejercicios) idList = recomend_ejericios(count, avg, 6) # print("idList") # pprint(idList) returnList = [] for ejer_id in idList: returnList.append(vars(ejer_dao.get_by_id(ejer_id))) return jsonify(returnList)
def create_ejercicio_kid(): dao = Ejercicio_KidDAO() dao.create_from_request(request) return vars(dao.add_to_db(dao))
def get_all_ejercicio_kid(): dao = Ejercicio_KidDAO() returnList = [] for c in dao.get_all(): returnList.append(vars(c)) return jsonify(returnList)
def get_count_ejercicios_categoria_kid_from_date(id_kid, date): dao = Ejercicio_KidDAO() ejercicios = dao.get_by_kid_week(id_kid, date) count = contar_ejercicios_por_categoria(ejercicios) return jsonify(count)
def get_ejercicio_kid_by_kid_date(id_kid, date): dao = Ejercicio_KidDAO() returnList = [] for d in dao.get_by_kid_week(id_kid, date): returnList.append(vars(d)) return jsonify(returnList)
def get_ejercicio_kid_by_kid(id_kid): dao = Ejercicio_KidDAO() returnList = [] for d in dao.get_by_kid_all(id_kid): returnList.append(vars(d)) return jsonify(returnList)