Opened 17 years ago
Closed 17 years ago
#5502 closed (duplicate)
Removing the automatic colon from newforms' _html_output
Reported by: | anonymous | Owned by: | Vincent Foley |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | newforms colon | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The _html_output() method automatically adds a colon at the end of a field's label if the label name does not end with a punctuation symbol. I move to completely remove this behavior and let the programmer choose if he wants a colon or not by specifying it him/herself in his form definition. Django should not make presentation decisions for the user.
Here is the code in question, it's in django/newforms/forms.py on line 132 in r6345
# Only add a colon if the label does not end in punctuation. if label[-1] not in ':?.!': label += ':'
Attachments (1)
Change History (4)
comment:1 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 17 years ago
Attachment: | label_colon_removal.patch added |
---|
comment:2 by , 17 years ago
Has patch: | set |
---|
Note:
See TracTickets
for help on using tickets.
I've added a (rather large) patch to fix the issue. The patch remove the three lines previously mentioned from forms.py and the rest of the patch is to fix the large suite of unit tests.