def put(self, id): comment = Comment.find_by_id(id) data = request.get_json() for key in data: setattr(comment, key, data[key]) db.session.commit() return comment.json()
def get(self, id): comment = Comment.find_by_id(id) return comment.json()