Ejemplo n.º 1
0
 def put(self, todo_id):
     item = get_item(todo_id)
     if not item:
         abort_if_todo_doesnt_exist(todo_id)
     args = parser.parse_args()
     status = args.get('status')
     if status and update_status(todo_id, status):
         item = get_item(todo_id)
         return item
     return {
         'Fail':
         'No status Parse. Please, use one of {}'.format(STATUS_LIST)
     }
Ejemplo n.º 2
0
 def delete(self, todo_id):
     item = get_item(todo_id)
     if not item:
         abort_if_todo_doesnt_exist(todo_id)
     delete_item(todo_id)
     return get_all_items()
Ejemplo n.º 3
0
 def get(self, todo_id):
     item = get_item(todo_id)
     if not item:
         abort_if_todo_doesnt_exist(todo_id)
     return item