python - Setting increasing ids in Django ChoiceField form -
Is there a way to change ID values in Django ChoiceField forms?
For example, I want Example: if id = "rating #" for output in my ChoiceField ID format, where there is a # incremental number, I assume that you have the widget attributes for the id Change, but how do I get a incremental number in the id?
& lt; Label = "id_rating_0" & gt; & Lt; Input type = "radio" id = "rating 1" value = "1" name = "rating" /> & Lt; / Labels & gt; & Lt; Label = "id_rating_1" & gt; & Lt; Input type = "radio" id = "rating 2" value = "2" name = "rating" /> & Lt; / Labels & gt; & Lt; Label = "id_rating_2" & gt; & Lt; Input type = "radio" id = "rating 3" value = "3" name = "rating" /> & Lt; / Labels & gt; & Lt; Label = "id_rating_3"> gt; & Gt; Input type = "radio" id = "rating 4" value = "4" name = "rating" /> & Lt; / Labels & gt; & Lt; Label = "id_rating_4"> gt; & Lt; Input type = "radio" id = "rating 5" value = "5" name = "rating" /> & Lt; / Labels & gt;
auto_id does not do the form parameter you want I am scared, I do not know what will happen:
Comments
Post a Comment