#20805 closed Bug (fixed)
form.label_suffix colon on admin checkboxes
Reported by: | Collin Anderson | Owned by: | Tim Graham |
---|---|---|---|
Component: | contrib.admin | Version: | 1.6-beta-1 |
Severity: | Release blocker | Keywords: | |
Cc: | Collin Anderson | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django1.5: http://snag.gy/JyMxI.jpg
django1.6b1: http://snag.gy/ilUNM.jpg
This is regression was introduced by #18134 584bd14dcfdee9585fec7794d53ce120ea73d0bc.
Here is the admin's algorithm for deciding when to add the colon:
https://github.com/django/django/blob/master/django/contrib/admin/helpers.py#L126
After the admin sets up the label it wants, it calls field.label_tag
which then adds the colon back.
Attachments (2)
Change History (10)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
by , 11 years ago
Attachment: | 20805.diff added |
---|
comment:2 by , 11 years ago
Has patch: | set |
---|---|
Needs documentation: | set |
by , 11 years ago
Attachment: | 20805.2.diff added |
---|
comment:3 by , 11 years ago
Needs documentation: | unset |
---|
Added a more general solution that allows overriding label_suffix
at the field level.
comment:4 by , 11 years ago
The patch is rather good, but I'm afraid it doesn't cover the use case when you call label_tag
in a template to render a checkbox field:
{{ form.cb_field }} {{ form.cb_field.label_tag }}
No better solution to propose yet...
comment:5 by , 11 years ago
...another case where calling methods with arguments would be quite nice...
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Adding a proposal to add an
include_label_suffix
kwarg tolabel_tag
. Will update the docs if this looks reasonable.