Opened 8 years ago

Closed 8 years ago

#5502 closed (duplicate)

Removing the automatic colon from newforms' _html_output

Reported by: anonymous Owned by: gnuvince
Component: Forms Version: master
Severity: Keywords: newforms colon
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 gnuvince 8 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by gnuvince

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to gnuvince
  • Patch needs improvement unset
  • Status changed from new to assigned

Changed 8 years ago by gnuvince

comment:2 Changed 8 years ago by gnuvince

  • 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 Changed 8 years ago by gnuvince

  • Resolution set to duplicate
  • Status changed from assigned to closed

Dupe. See #4975

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