def delete(request): weibo_id = int(request.query['weibo_id']) Weibo.delete(weibo_id) cs = Comment.all(weibo_id=weibo_id) for c in cs: c.delete() return redirect('/weibo/index')
def delete(request): weibo_id = int(request.query['weibo_id']) print('shuchu') Weibo.delete(weibo_id) cs = Comment.all(weibo_id=int(weibo_id)) for c in cs: c.delete(c.id) return redirect('/weibo/index')
def comments(self): cs = Comment.all(weibo_id=self.id) return cs