Skip to content

Commit

Permalink
do not export pointer keys for csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
jchate6 committed Aug 2, 2024
1 parent d95f77f commit 94ba87d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tom_targets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def export_targets(qs):
for name in names:
target_data[f'name{str(name_index)}'] = name.name
name_index += 1
del target_data['id'] # do not export 'id'
# do not export 'pk's
for pointer_key in [pk for pk in target_data.keys() if pk.endswith('_ptr_id')]:
del target_data[pointer_key]
del target_data['id']
writer.writerow(target_data)
return file_buffer

Expand Down

0 comments on commit 94ba87d

Please sign in to comment.