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)

label_colon_removal.patch (90.3 KB ) - added by Vincent Foley 17 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by Vincent Foley, 17 years ago

Owner: changed from nobody to Vincent Foley
Status: newassigned

by Vincent Foley, 17 years ago

Attachment: label_colon_removal.patch added

comment:2 by Vincent Foley, 17 years ago

Has patch: set

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.

comment:3 by Vincent Foley, 17 years ago

Resolution: duplicate
Status: assignedclosed

Dupe. See #4975

Note: See TracTickets for help on using tickets.
Back to Top