sync_mongo.py 文件源码

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

项目:fieldsight-kobocat 作者: awemulya 项目源码 文件源码
def handle(self, *args, **kwargs):
        user = xform = None
        if len(args) > 0:
            username = args[0]
            try:
                user = User.objects.get(username=username)
            except User.DoesNotExist:
                raise CommandError("User %s does not exist" % username)
        if len(args) > 1:
            id_string = args[1]
            try:
                xform = XForm.objects.get(user=user, id_string=id_string)
            except XForm.DoesNotExist:
                raise CommandError("Xform %s does not exist for user %s" %
                                   (id_string, user.username))

        remongo = kwargs["remongo"]
        update_all = kwargs["update_all"]

        report_string = mongo_sync_status(remongo, update_all, user, xform)
        self.stdout.write(report_string)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号