Exemple #1
0
    def post(self):
        if not users.is_current_user_admin():
            return self.redirect('/')

        # Extract values from json
        json = simplejson.loads(self.request.get('json'))

        # Create a recipe
        therecipe = Recipe()
        therecipe.set_from_dict(json)

        self.redirect('/recipe/%s' % therecipe.key())