Opened 18 years ago
Closed 18 years ago
#6164 closed (fixed)
form generation sample code in docs prints label twice
| Reported by: | annacoder | Owned by: | arien |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Keywords: | newforms | |
| 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
in this part of the docs: http://www.djangoproject.com/documentation/newforms/#highlighting-required-fields-in-templates,
the following sample code,
{% for field in form %}
<dt>{{ field.label_tag }}{{ field.label }}{% if field.field.required %}*{% endif %}</dt>
prints the label twice
Attachments (1)
Change History (4)
comment:1 by , 18 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
| Triage Stage: | Unreviewed → Accepted |
by , 18 years ago
comment:2 by , 18 years ago
| Has patch: | set |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
comment:3 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
The output contains lines like the following:
<dt><label for="id_subject">Subject</label>Subject*</dt>I'll attach a patch so that it generates this instead:
<dt><label for="id_subject">Subject</label>*</dt>