#23690 closed Cleanup/optimization (fixed)
Docs for Rendering fields manually <label for="...."> showing static rather than dynamic code
Reported by: | awidgery | Owned by: | Neven Munđar |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
See here:
https://docs.djangoproject.com/en/1.7/topics/forms/#rendering-fields-manually
<div class="fieldWrapper"> {{ form.subject.errors }} <label for="id_subject">Email subject:</label> {{ form.subject }} </div>
Wouldn't it be better to show:
<div class="fieldWrapper"> {{ form.subject.errors }} <label for="{{ form.subject.id_for_label }}">Email subject:</label> {{ form.subject }} </div>
Change History (7)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 10 years ago
Has patch: | set |
---|---|
Triage Stage: | Accepted → Ready for checkin |
PR #3524 LGTM.
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
That seems fine to me. In the ticket you original had
auto_id
, but I think you meantid_for_label
so I edited the description. We might also want to note the alternative of{{ field.label_tag }}
for that entire line, presuming you have made all the customizations on the form.