Opened 3 years ago

Closed 3 years ago

#19066 closed Cleanup/optimization (duplicate)

ManyToMany Field doesn't allow help_text override

Reported by: rjalves Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When using ModelForms with Models that include ManyToManyField's there's a default help_text message:
"Hold down "Control", or "Command" on a Mac, to select more than one."

If you use a different widget for fields of this type, such as CheckboxSelectMultiple, the help_text message makes no sense.

The way it's currently implemented the message is always appended to what is passed.

The attached patch changes this such that the message is only displayed if the empty string is passed (which is also the default by omission).

Attachments (1)

0001-Allow-overriding-help_text-default-message-on-ManyTo.patch (5.1 KB) - added by rjalves 3 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 3 years ago by rjalves

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I couldn't find documentation specific to the behavior of help_text in ManyToManyField.
Since this affects public API, should documentation be created? If so, please point out where it should be added.

Thanks

PS: Possible duplicate of #9321 (only found it afterwards) but with different patch target.

comment:2 Changed 3 years ago by aaugustin

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

Indeed, it's a duplicate. I'll link to your patch from the other ticket, let's continue the discussion over there.

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