<s> from __future__ import unicode_literals <EOL> import django <EOL> from django . db import models , migrations <EOL> def separate_order_delivery_times ( apps , schema_editor ) : <EOL> OrderDeliveryTime = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> DeliveryTimeOrder = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> for old_odt in OrderDeliveryTime . objects . all ( ) : <EOL> delivery = old_odt . deliverytime_ptr <EOL> order = old_odt . order <EOL> DeliveryTimeOrder . objects . get_or_create ( order = order , <EOL> defaults = dict ( min = delivery . min , <EOL> max = delivery . max , <EOL> unit = delivery . unit , <EOL> description = delivery . description ) ) <EOL> delivery . delete ( ) <EOL> def concat_order_delivery_times ( apps , schema_editor ) : <EOL> OrderDeliveryTime = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> DeliveryTimeOrder = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> for new_odt in DeliveryTimeOrder . objects . all ( ) : <EOL> OrderDeliveryTime . objects . get_or_create ( order = new_odt . order , <EOL> defaults = dict ( min = new_odt . min , <EOL> max = new_odt . max , <EOL> unit = new_odt . unit , <EOL> description = new_odt . description ) ) <EOL> new_odt . delete ( ) <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<STR_LIT>' , <EOL> fields = [ <EOL> ( '<STR_LIT:id>' , models . AutoField ( verbose_name = '<STR_LIT>' , serialize = False , auto_created = True , primary_key = True ) ) , <EOL> ( '<STR_LIT>' , models . FloatField ( verbose_name = '<STR_LIT>' ) ) , <EOL> ( '<STR_LIT>' , models . FloatField ( verbose_name = '<STR_LIT>' ) ) , <EOL> ( '<STR_LIT>' , models . PositiveSmallIntegerField ( default = <NUM_LIT:2> , verbose_name = '<STR_LIT>' , choices = [ ( <NUM_LIT:1> , '<STR_LIT>' ) , ( <NUM_LIT:2> , '<STR_LIT>' ) , ( <NUM_LIT:3> , '<STR_LIT>' ) , ( <NUM_LIT:4> , '<STR_LIT>' ) ] ) ) , <EOL> ( '<STR_LIT:description>' , models . TextField ( verbose_name = '<STR_LIT>' , blank = True ) ) , <EOL> ( '<STR_LIT>' , models . OneToOneField ( related_name = '<STR_LIT>' , verbose_name = '<STR_LIT>' , to = '<STR_LIT>' ) ) , <EOL> ] , <EOL> options = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> ) , <EOL> migrations . RunPython ( separate_order_delivery_times , concat_order_delivery_times ) , <EOL> migrations . RemoveField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT>' , <EOL> ) , <EOL> migrations . RemoveField ( <EOL> model_name = '<STR_LIT>' , <EOL> name = '<STR_LIT>' , <EOL> ) , <EOL> migrations . DeleteModel ( <EOL> name = '<STR_LIT>' , <EOL> ) , <EOL> ] </s>
