# Generated by Django 3.1.2 on 2020-12-31 00:25

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

def slugify_name(apps, schema_editor):
    '''
    We can't import the Product model directly as it may be a newer
    version than this migration expects. We use the historical version.
    '''
    Post = apps.get_model('artikel', 'Product')
    for product in Product.objects.all():
        product.slug = slugify(product.name)
        product.save()

class Migration(migrations.Migration):

    dependencies = [
        ('artikel', '0003_product_slug'),
    ]

    operations = [
    ]
