def s(): if request.method == 'POST': query = request.form['query'] new_recipe = Recipe(ingredients=query) json_data = new_recipe.GetRequest_Ingredients() recipe_dict = new_recipe.process_recipe_ID_summary(json_data) recipes = new_recipe.return_results(recipe_dict) return render_template( 'search.html', results=recipes) #the recipes we want to display
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