Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
def create_ejercicio_kid():
    dao = Ejercicio_KidDAO()
    dao.create_from_request(request)
    return vars(dao.add_to_db(dao))
Exemple #4
0
def get_all_ejercicio_kid():
    dao = Ejercicio_KidDAO()
    returnList = []
    for c in dao.get_all():
        returnList.append(vars(c))
    return jsonify(returnList)
Exemple #5
0
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)
Exemple #6
0
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)
Exemple #7
0
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)