I have django form which consist of one choice field with following choices

Choices = [('attr1', 1), ('attr1', 2), ('attr3',3), ('attr2',1), ('attr2',2), 
('attr2', 3)]

If I do value = form.cleaned_data('value')

It is returning the value ( I,e attr1 or attr2) .in this case how can I get the 
label(or name) of the choicefield.


I tried

for val in cf.fields['value'].choices:

    if val[0] == cf.cleaned_data['value']:

              print val[1]

              break

_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to