def display_recipe(userid, recipeid): """Retrieves an individual recipe from db for display.""" recipe = Recipe.get_recipe(recipeid) ingredients = Ingredient.get_recipe_ingredients(recipeid) recipe_hashtags = Recipe_Hashtag.get_recipe_hashtags(recipeid) return render_template("recipe_info.html", recipe=recipe, ingredients=ingredients, recipe_hashtags=recipe_hashtags, userid=userid)
def edit_recipe(userid, recipeid): """Get a recipe from the db, and display it so the user can edit.""" recipe = Recipe.get_recipe(recipeid) ingredients = Ingredient.get_recipe_ingredients(recipeid) recipe_hashtags = Recipe_Hashtag.get_recipe_hashtags(recipeid) hashtag_list = Recipe_Hashtag.get_hashtag_names_for_recipe(recipe_hashtags) readable_hashtags = Hashtag.get_readable_hashtags(hashtag_list) recreated_hashtag_input = Hashtag.recreate_hashtag_input(readable_hashtags) return render_template("edit_recipe.html", recipe=recipe, ingredients=ingredients, userid=userid, recreated_hashtag_input=recreated_hashtag_input)