2👍
<div class="form-group">
{% for field in form %}
<label for="id_Fullname" id="{{ field.name }}">Full Name:</label>
{{ field }}
{% endfor %}
</div>
try this
1👍
You can use the id_for_label
property of field
:
Use this property to render the ID of this field. For example, if you are manually constructing a <label> in your template.
<div class="form-group">
<label for="{{ form.Fullname.id_for_label }}">Full Name:</label>
{{ form.Fullname }}
</div>
0👍
This was an error of placing the def init function inside Class Meta: instead of Class ContactInfo. I had not realized I had indented it improperly.
- [Django]-DRF: Always apply default permission class
- [Django]-"detail": "method \delete\ not allowed" django
- [Django]-Django prefetch_related & Prefetch nested
- [Django]-Django TemplateDoesNotExist admin/login.html
- [Django]-Track django admin with Google Analytics
Source:stackexchange.com