I am going to assume this is simple and the issue is that I am missing the obvious.
I have variables defined like so:
What i want to now do is use the selected_column to change the variable it is now equal to, so that it is now equal to 'selected'
E.g. If asc_location_of_test was click then
I have variables defined like so:
# First I define all the variables desc_part_number = 'not_selected' asc_part_number = 'not_selected' desc_product_serial_number = 'not_selected' asc_product_serial_number = 'not_selected' desc_result_arrow = 'not_selected' asc_result_arrow = 'not_selected' desc_date_time = 'not_selected' asc_date_time = 'not_selected' desc_location_of_test = 'not_selected' asc_location_of_test = 'not_selected' desc_test_equipment_set = 'not_selected' asc_test_equipment_set = 'not_selected' # Now I sees which column was selected by looking at other variables defined earlier in the function selected_column = my_order_direction+'_'+order_columnThe combination of "my_order_direction+'_'+order_column " will make selected_column equal to one of the previously defined variables.
What i want to now do is use the selected_column to change the variable it is now equal to, so that it is now equal to 'selected'
E.g. If asc_location_of_test was click then
selected_column = asc_location_of_testAnd the variable asc_location_of_test would be changed
asc_location_of_test = 'selected' # The rest of the variables would still equal 'not_selected'Ideally I do not want to use a large combination of if statement