示例#1
0
    def get(self):
        # Check if the list name is provided
        list_key = self.request.get('list_key')
        
        try:
            # Add the new list to the database
            grocery_list_key = ItemList.delete(list_key)

            # Respond with the list key
            self.response.set_status(201)
            self.response.write(grocery_list_key)
        except Exception as e:
            # Respond with the error
            self.response.set_status(406)
            self.response.write(str(e))
示例#2
0
    def get(self):

        # Check if the list name is provided
        list_key = self.request.get('list_key')
        changed_content_str = self.request.get('changed_content')

        try:
            # Add the new list to the database
            changed_content = JSON.decode(changed_content_str)
            new_content = ItemList.update_content(list_key, changed_content)

            # Respond with the list key
            self.response.set_status(201)
            self.response.write(new_content)
        except Exception as e:
            # Respond with the error
            self.response.set_status(406)
            self.response.write(str(e))