0002_integrate_w_mercator.py 文件源码

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

项目:django-happenings 作者: natgeosociety 项目源码 文件源码
def initialize_slug(apps, schema_editor):
    # We can't import the Person model directly as it may be a newer
    # version than this migration expects. We use the historical version.
    Event = apps.get_model("happenings", "Event")  # NOQA
    for event in Event.objects.all():
        if event.slug is None:
            event.slug = slugify(event.title)
            event.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号