[Fixed]-Extracting Value of Label from Select Statement in Django View

1👍

Because the keys are integers, but image_filter_key_index is a unicode char u'1'. You need to convert it first then try to access the label:

image_filter_key_label = dict(form.fields['image_filter_key'].choices)[int(image_filter_key_index)]

Leave a comment