Add option to delete columns

This commit is contained in:
Oliver Walters 2019-06-28 20:24:18 +10:00
parent 54762713f3
commit 3c2f3c2c2c
2 changed files with 8 additions and 0 deletions

View File

@ -35,6 +35,7 @@
{% for req in req_cols %}
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
{% endfor %}
<option value='Delete'>Delete Column</option>
</select>
{% if col.duplicate %}
<p class='help-inline'>Duplicate column selection</p>

View File

@ -767,6 +767,9 @@ class BomUpload(AjaxView, FormMixin):
col_id = int(item.replace('col_select_', ''))
col_name = value
if value.lower() == 'delete':
continue
column_selections[col_id] = value
# Extract the row data
@ -822,6 +825,10 @@ class BomUpload(AjaxView, FormMixin):
row = row_data[row_idx]
items = []
for col_idx in sorted(row.keys()):
if not col_idx in column_selections.keys():
continue
value = row[col_idx]
items.append(value)