예제 #1
0
파일: weibo.py 프로젝트: fxyan/Dawn
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')
예제 #2
0
 def comments(self):
     comments = Comment.all(weibo_id=self.id)
     return comments
예제 #3
0
def all():
	comment_list = Comment.all()
	if comment_list is not None:
		comments = Comment.all_json(comment_list)
		return jsonify(comments)