<s> from __future__ import unicode_literals <EOL> from django . db import migrations <EOL> OPERATION_TYPES = ( <EOL> ( <NUM_LIT:1> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ( <NUM_LIT> , '<STR_LIT>' , [ ] ) , <EOL> ] ) <EOL> ] ) , <EOL> ) <EOL> def load_operation ( model , obj_id , name , parent , children ) : <EOL> obj = model . objects . create ( <EOL> id = obj_id , <EOL> pk = obj_id , <EOL> name = name , <EOL> parent = parent , <EOL> ** { '<STR_LIT>' : <NUM_LIT:0> , '<STR_LIT>' : <NUM_LIT:0> , '<STR_LIT>' : <NUM_LIT:0> , '<STR_LIT>' : <NUM_LIT:0> } <EOL> ) <EOL> for child_id , child_name , child_children in children : <EOL> load_operation ( model , child_id , child_name , obj , child_children ) <EOL> def load_initial_data ( apps , schema_editor ) : <EOL> OperationType = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> for op_id , op_name , op_children in OPERATION_TYPES : <EOL> load_operation ( OperationType , op_id , op_name , None , op_children ) <EOL> def unload_initial_data ( apps , schema_editor ) : <EOL> OperationType = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> OperationType . objects . all ( ) . delete ( ) <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . RunPython ( <EOL> load_initial_data , reverse_code = unload_initial_data <EOL> ) , <EOL> ] </s>
