0141_fill_org_slugs.py 文件源码

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

项目:Sentry 作者: NetEaseGame 项目源码 文件源码
def forwards(self, orm):
        from sentry.constants import RESERVED_ORGANIZATION_SLUGS
        from sentry.db.models.utils import slugify_instance
        from sentry.utils.query import RangeQuerySetWrapperWithProgressBar

        Organization = orm['sentry.Organization']

        queryset = Organization.objects.filter(slug__isnull=True)

        for org in RangeQuerySetWrapperWithProgressBar(queryset):
            slugify_instance(org, org.name, RESERVED_ORGANIZATION_SLUGS)
            org.save()
            transaction.commit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号