<s> from __future__ import unicode_literals <EOL> from django . db import models , migrations <EOL> def create_ocr_setting_for_existing_document_types ( apps , schema_editor ) : <EOL> DocumentType = apps . get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> DocumentTypeSettings = apps . get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> for document_type in DocumentType . objects . all ( ) : <EOL> try : <EOL> DocumentTypeSettings . objects . create ( document_type = document_type ) <EOL> except DocumentTypeSettings . DoesNotExists : <EOL> pass <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . CreateModel ( <EOL> name = '<STR_LIT>' , <EOL> fields = [ <EOL> ( <EOL> '<STR_LIT:id>' , models . AutoField ( <EOL> verbose_name = '<STR_LIT>' , serialize = False , auto_created = True , <EOL> primary_key = True <EOL> ) <EOL> ) , <EOL> ( <EOL> '<STR_LIT>' , models . BooleanField ( <EOL> default = True , <EOL> verbose_name = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> ) , <EOL> ( <EOL> '<STR_LIT>' , models . OneToOneField ( <EOL> related_name = '<STR_LIT>' , <EOL> verbose_name = '<STR_LIT>' , <EOL> to = '<STR_LIT>' <EOL> ) <EOL> ) , <EOL> ] , <EOL> options = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> bases = ( models . Model , ) , <EOL> ) , <EOL> migrations . RunPython ( create_ocr_setting_for_existing_document_types ) , <EOL> ] </s>
