create_fake_comment.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:Server 作者: malaonline 项目源码 文件源码
def handle(self, *args, **options):
        for order in models.Order.objects.all():
            for timeslot in order.timeslot_set.filter(comment__isnull=True):
                fake_comment = models.Comment()
                fake_comment.score = timeslot.id % 5 + 1
                fake_comment.content = "fake comment {id}".format(id=timeslot.id)
                fake_comment.save()
                timeslot.comment = fake_comment
                timeslot.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号