from __future__ import unicode_literals

from django.db import migrations


def update_price_calculator(apps, schema_editor):
    ShippingMethod = apps.get_model("shipping", "ShippingMethod")
    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.NetShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.NetPriceCalculator"
        shipping_method.save()

    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.GrossShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.GrossPriceCalculator"
        shipping_method.save()


class Migration(migrations.Migration):

    dependencies = [
        ('shipping', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(update_price_calculator),
    ]

from __future__ import unicode_literals

from django.db import migrations


def update_price_calculator(apps, schema_editor):
    ShippingMethod = apps.get_model("shipping", "ShippingMethod")
    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.NetShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.NetShippingMethodPriceCalculator"
        shipping_method.save()

    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.GrossShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.GrossShippingMethodPriceCalculator"
        shipping_method.save()


class Migration(migrations.Migration):

    dependencies = [
        ('shipping', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(update_price_calculator),
    ]

Fix price calculator class names
Fix price calculator class names
  from __future__ import unicode_literals
  
  from django.db import migrations
  
  
  def update_price_calculator(apps, schema_editor):
      ShippingMethod = apps.get_model("shipping", "ShippingMethod")
      for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.NetShippingMethodPriceCalculator"):
-         shipping_method.price_calculator = "lfs.shipping.calculator.NetPriceCalculator"
+         shipping_method.price_calculator = "lfs.shipping.calculator.NetShippingMethodPriceCalculator"
          shipping_method.save()
  
      for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.GrossShippingMethodPriceCalculator"):
-         shipping_method.price_calculator = "lfs.shipping.calculator.GrossPriceCalculator"
+         shipping_method.price_calculator = "lfs.shipping.calculator.GrossShippingMethodPriceCalculator"
          shipping_method.save()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('shipping', '0001_initial'),
      ]
  
      operations = [
          migrations.RunPython(update_price_calculator),
      ]
  
Fix price calculator class names
## Code Before:
from __future__ import unicode_literals

from django.db import migrations


def update_price_calculator(apps, schema_editor):
    ShippingMethod = apps.get_model("shipping", "ShippingMethod")
    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.NetShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.NetPriceCalculator"
        shipping_method.save()

    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.GrossShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.GrossPriceCalculator"
        shipping_method.save()


class Migration(migrations.Migration):

    dependencies = [
        ('shipping', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(update_price_calculator),
    ]

## Instruction:
Fix price calculator class names
## Code After:
from __future__ import unicode_literals

from django.db import migrations


def update_price_calculator(apps, schema_editor):
    ShippingMethod = apps.get_model("shipping", "ShippingMethod")
    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.NetShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.NetShippingMethodPriceCalculator"
        shipping_method.save()

    for shipping_method in ShippingMethod.objects.filter(price_calculator="lfs.shipping.GrossShippingMethodPriceCalculator"):
        shipping_method.price_calculator = "lfs.shipping.calculator.GrossShippingMethodPriceCalculator"
        shipping_method.save()


class Migration(migrations.Migration):

    dependencies = [
        ('shipping', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(update_price_calculator),
    ]
