Beispiel #1
0
 def put(self, id):
     idea = Idea.find_by_id(id)
     data = request.get_json()
     for key in data:
         setattr(idea, key, data[key])
     db.session.commit()
     return idea.json()
Beispiel #2
0
 def delete(self, id):
     idea = Idea.find_by_id(id)
     db.session.delete(idea)
     db.session.commit()
     return {"msg": 'Idea deleted', 'payload': idea.id}
Beispiel #3
0
 def get(self, id):
     idea = Idea.find_by_id(id)
     return idea.json()