| | 1 | Goal: |
| | 2 | Add attributes like "class" to the label tag for inputs. |
| | 3 | |
| | 4 | Problem: |
| | 5 | Actually the only thing thats stops me from using {{ form }} is the incapability to change classes for labels easily. So i have to do it like this, for every form and every field: |
| | 6 | |
| | 7 | {{{ |
| | 8 | {{ form.non_field_errors }} |
| | 9 | <div class="fieldWrapper"> |
| | 10 | {{ form.subject.errors }} |
| | 11 | <label for="{{ form.subject.id_for_label }}" class="MY-CUSTOM-CLASS">Email subject:</label> |
| | 12 | {{ form.subject }} |
| | 13 | </div> |
| | 14 | |
| | 15 | }}} |
| | 16 | |
| | 17 | Where it should be changed: |
| | 18 | I would be fine if the label_attrs could be set in BaseForm(), but i think the right place would be class Field |
| | 19 | |