def delete(): weibo_id = int(request.args.get('id')) w = Weibo.remove(weibo_id) comments = Comment.find_all(weibo_id=weibo_id) for comment in comments: Comment.remove(comment.id) return jsonify(w.json())
def comments(self): return Comment.find_all(weibo_id=self.id)