28 lines
645 B
Python
28 lines
645 B
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.9.6 on 2016-05-15 16:15
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def ensure_slugs(apps, schema_editor):
|
|
ProductCategory = apps.get_model('shop', 'ProductCategory')
|
|
Product = apps.get_model('shop', 'Product')
|
|
|
|
for category in ProductCategory.objects.all():
|
|
category.save()
|
|
|
|
for product in Product.objects.all():
|
|
product.save()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('shop', '0005_product_slug'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(ensure_slugs, migrations.RunPython.noop)
|
|
]
|