def get(self): recipes = Recipe.all() recipes.filter('user_id = ', users.get_current_user().user_id()) tmpl = jinja_env.get_template('list.html') self.response.out.write( render_template('list.html', recipes=recipes, base_url=self.request.host_url))
def post(self): recipe = Recipe.from_json(self.request.get('recipe')) # Make sure nobody tries to write to someone else's stream if recipe.user_id != users.get_current_user().user_id(): self.error(400) return recipe.put()
def get(self): key = db.Key(self.request.get('id')) recipe = Recipe.get(key) self.response.out.write( render_template('view.html', recipe=recipe))