Example #1
0
def s():
    #if request.method == 'GET':
    query = request.args.get('query')
    # query.split()
    # query = ','.join(query)
    query = str(query)
    new_recipe = Recipe(ingredients=query)
    #print(new_recipe)
    json_data = new_recipe.GetRequest_Ingredients()
    #print(json_data)
    recipe_dict = new_recipe.process_recipe_ID_summary(json_data)
    recipes = new_recipe.return_results(recipe_dict)
    instructions = new_recipe.display_instructions(recipe_dict)
    ingredients = new_recipe.display_ingredients(recipe_dict)
    print(instructions)
    return render_template(
        'search.html',
        results=recipes,
        json_file=json_data,
        instructions=instructions,
        ingredients=ingredients)  #the recipes we want to display