Reverse name and ID in the search dictionary

when partner_ids = {rows[id]:rows[name] for rows in reader}, it will replace IDs with names
When partner_ids = {rows[name]:rows[id] for rows in reader}, it will replace names with IDs
This commit is contained in:
David Todd 2016-04-26 13:02:12 -05:00
parent 358a7d7da7
commit 1ecc1b50f6
No known key found for this signature in database
GPG Key ID: 48E847F18074C953

View File

@ -64,7 +64,7 @@ with open(config['partner_path'], 'r') as partner_csv:
raise ValueError('Either id or name could not be indexed with find_index') raise ValueError('Either id or name could not be indexed with find_index')
exit(1) exit(1)
partner_ids = {rows[id]:rows[name] for rows in reader} # Build a dict containing the company names as the keys and the __export__IDs as values partner_ids = {rows[name]:rows[id] for rows in reader} # Build a dict containing the company names as the keys and the __export__IDs as values
reader = None reader = None
# Open both the import_csv and temp_csv files # Open both the import_csv and temp_csv files