Ejemplo n.º 1
0
 def get_cats_names(userid, tipo):
     registros = RegistroData.get_categorias(userid, tipo)
     cat_nombres = []
     for r in registros:
         for categoria in r["categoria"]:
             if categoria not in cat_nombres:
                 cat_nombres.append(categoria)
     return cat_nombres
Ejemplo n.º 2
0
 def get_cats(userid, tipo):
     registros = RegistroData.get_categorias(userid, tipo)
     c = {}
     for r in registros:
         for categoria in r["categoria"]:
             if categoria in c:
                 c[categoria] += r["valor"]
             else:
                 c[categoria] = r["valor"]
     return c