def migrate_v3():
    # Run this quickly before or after deployment
    Blog.add_to_class('base_url', models.CharField('Base URL', max_length=200))
    for blog in Blog.objects.all():
        blog.url = '/blog/' + blog.base_url
        blog.save()

    Post._meta.get_field('last_update').auto_now = False
    for post in Post.objects.all():
        if post.url and post.published_on and post.url not in '/':
            post.url = post.blog.url_prefix + '%04d/%02d/' % (post.published_on.year, post.published_on.month) + post.url
        post.save()

    Page._meta.get_field('last_update').auto_now = False
    for page in Page.objects.all():
        page.save()
dataset/ETHPy150Open adieu/allbuttonspressed/_migrate.py/migrate_v3/swapped operands of `not in`