def post(self): key = self.request.get('key') logging.debug("Deleting sticky " + key) if not users.is_current_user_admin(): return self.redirect(users.create_login_url(self.request.url)) sticky = Sticky.get(key) sticky.delete() self.response.out.write("SUCCESS")
def post(self, recipe_key): recipe = Recipe.get(recipe_key) if users.is_current_user_admin() and recipe != None: sticky = Sticky() sticky.recipe = recipe sticky.text = self.request.get('text') sticky.put() self.response.headers['Content-Type'] = 'text/javascript' self.response.out.write(simplejson.dumps(sticky.to_dict()))