# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2018-03-18 11:45 from __future__ import unicode_literals from django.db import migrations def populate_camp_shortslugs(apps, schema_editor): Camp = apps.get_model("camps", "Camp") for camp in Camp.objects.all(): if not camp.shortslug: camp.shortslug = camp.slug camp.save() class Migration(migrations.Migration): dependencies = [("camps", "0023_camp_shortslug")] operations = [migrations.RunPython(populate_camp_shortslugs)]