le75
clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

0015_auto_20161001_1622.py
text/x-python

Download raw (621 bytes)

# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-01 14:22
from __future__ import unicode_literals

from django.db import migrations
from django.utils.text import slugify


class Migration(migrations.Migration):

    def populate_slugs(apps, schema_editor):
        Orientation = apps.get_model("course", "Orientation")
        for orientation in Orientation.objects.all():
            orientation.slug = slugify(orientation.name)
            orientation.save()

    dependencies = [
        ('course', '0014_orientation_slug'),
    ]

    operations = [
        migrations.RunPython(populate_slugs),
    ]