Re: forms.ChoiceField get displayed value

2011-01-20 Thread Scott Gould
Try something like this: field = form.fields['property'] data = form.cleaned_data['property'] if isinstance(data, (list, tuple)): # for multi-selects friendly_name = [x[1] for x in field.field.choices if x[0] in data] else:

forms.ChoiceField get displayed value

2011-01-20 Thread Dan
If have a ChoiceField in a form (sometimes dynamically changed with javascript) when getting the cleaned_data for that field it will always return the value. i.e: Property1 self.cleaned_data.get('property') will always return '1' How can i access the displayed value 'Property1' ? Thanks -Da