def create_columns(self):
reader = self._get_csv_reader()<EOL>headings = six.next(reader)<EOL>try:<EOL><INDENT>examples = six.next(reader)<EOL><DEDENT>except StopIteration:<EOL><INDENT>examples = []<EOL><DEDENT>found_fields = set()<EOL>for i, value in enumerate(headings):<EOL><INDENT>if i >= <NUM_LIT:20>:<EOL><INDENT>break<EOL><DEDENT>infer_field = self.has_headings and value not in found_fields<EOL>to_field = (<EOL>{<EOL>"<STR_LIT:date>": "<STR_LIT:date>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:description>": "<STR_LIT:description>",<EOL>"<STR_LIT>": "<STR_LIT:description>",<EOL>"<STR_LIT>": "<STR_LIT:description>",<EOL>}.get(value.lower(), "<STR_LIT>")<EOL>if infer_field<EOL>else "<STR_LIT>"<EOL>)<EOL>if to_field:<EOL><INDENT>found_fields.add(to_field)<EOL><DEDENT>TransactionCsvImportColumn.objects.update_or_create(<EOL>transaction_import=self,<EOL>column_number=i + <NUM_LIT:1>,<EOL>column_heading=value if self.has_headings else "<STR_LIT>",<EOL>to_field=to_field,<EOL>example=examples[i].strip() if examples else "<STR_LIT>",<EOL>)<EOL><DEDENT>
For each column in file create a TransactionCsvImportColumn