Exemplo n.º 1
0
 def put(self, list_id):
     ilist = ListModel.find_by_id(list_id)
     ilist_data = list_schema.load(request.get_json())
     if ilist:
         ilist.title = ilist_data.title
     else:
         ilist_data.save_to_db()
     ilist.save_to_db()
     return list_schema.dump(ilist)
Exemplo n.º 2
0
 def delete(self, list_id):
     ilist = ListModel.find_by_id(list_id)
     if ilist:
         ilist.delete_from_db()
         return{"message":"list deleted"}, 200
     return{"message":"list not found"}    
Exemplo n.º 3
0
 def get(self, list_id):
     ilist = ListModel.find_by_id(list_id)
     if ilist:
         return ilist.json()
     return {"message":"not found"}, 404