# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-16 04:51
from __future__ import unicode_literals

from django.db import migrations


def update_price_calculator(apps, schema_editor):
    Shop = apps.get_model("core", "Shop")
    for shop in Shop.objects.all():
        if shop.price_calculator == "lfs.net_price.NetPriceCalculator":
            shop.price_calculator = "lfs.net_price.calculator.NetPriceCalculator"
        elif shop.price_calculator == "lfs.gross_price.GrossPriceCalculator":
            shop.price_calculator = "lfs.gross_price.calculator.GrossPriceCalculator"
        shop.save()


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0002_auto_20150428_2039'),
    ]

    operations = [
        migrations.RunPython(update_price_calculator),
    ]
