Exemplo n.º 1
0
Arquivo: weibo.py Projeto: 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')
Exemplo n.º 2
0
 def comments(self):
     comments = Comment.all(weibo_id=self.id)
     return comments
Exemplo n.º 3
0
def all():
	comment_list = Comment.all()
	if comment_list is not None:
		comments = Comment.all_json(comment_list)
		return jsonify(comments)