def delete(request): weibo_id = int(request.query['weibo_id']) Weibo.delete(weibo_id) comments = Comment.all(weibo_id=weibo_id) for comment in comments: Comment.delete(comment.id) return redirect('/weibo')
def comments(self): comments = Comment.all(weibo_id=self.id) return comments
def all(): comment_list = Comment.all() if comment_list is not None: comments = Comment.all_json(comment_list) return jsonify(comments)