# Generated by Django 2.2.4 on 2019-09-27 08:45 from django.db import migrations def fill_slug(apps,schemaeditor): News = apps.get_model('news', 'News') for news in News.objects.all(): if news.slug is None: news.slug = f'Slug {news.id}' news.save() class Migration(migrations.Migration): dependencies = [ ('news', '0013_auto_20190924_0806'), ] operations = [ migrations.RunPython(fill_slug, migrations.RunPython.noop) ]