Exemple #1
0
 def getcocking(self, dbsession, ing):
     d = dict()
     d['ingredients'] = dbUtils.getRecipe(dbsession, int(ing))
     d['list'] = dbUtils.getIngList(dbsession)
     return d
Exemple #2
0
#                 if ingredient.qty_avail < recipe.quantity:
#                     r+= 1
#             else:
#                 r = 1
#             reason.append(r)
#     else:
#         for cocktail, recipe, ingredient  in session.query(Cocktail, Recipe, Ingredient).\
#                                 filter(Cocktail.cocktail_id == Recipe.cocktail_id).\
#                                 filter(Recipe.ingredient_id == Ingredient.ingredient_id).\
#                                 filter(Ingredient.qty_avail < Recipe.quantity).all():
#             discarded.append(cocktail)
#             reason.append(1)
#             
#     for cocktail in session.query(Cocktail).all():
#         try:
#             r = discarded.index(cocktail)
#             print(reason)
#             print(reason[r])
#             cocktails.append([cocktail, reason[r]])
#         except:
#             cocktails.append([cocktail, 0])
#                 
#     print(discarded)
#     print(cocktails)
#         
    print(getCocktails(session, alcool))
    print(getIngredients(session))
    print(getPumps(session))
    print(getRecipe(session, 3))
    print(getServe(session, 2))