python - Setting increasing ids in Django ChoiceField form -


Is there a way to change ID values ​​in Django ChoiceField forms?

For example, I want 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?

Example:

  & 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;    

if auto_id does not do the form parameter you want I am scared, I do not know what will happen:



Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -