Example #1
0
 def post(self):
     recipe = Recipe()
     
     recipe.title = self.request.get("title")
     recipe.author = self.request.get("author")
     recipe.cookbook = self.request.get("cookbook")
     recipe.set_photo(self.request.get("img"))
     
     ingredients = self.request.get_all("ingredient")
     
     recipe.put()
     
     for ingredient in ingredients:
         RecipeItem(recipe=recipe, ingredient=ingredient).put()
     
     template_values = {
         "recipe": recipe,
         "location_provider": RecipeLocationProvider()
     }
     self.render_template("float_element.html", template_values)