Opened 14 years ago
Closed 14 years ago
#16370 closed Bug (duplicate)
All ManyToMany field get a default message which is not overridable
| Reported by: | Anand Kumria | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.3 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
All ManyToManyFields get a default message in the help_text, which is not overridable.
The message is: 'Hold down "Control", or "Command" on a Mac, to select more than one.'
This is done in the file django/db/models/fields/related.py and it makes sense if the related field is being displayed as a select list.
However, if you display a many to many relation using the inbuilt CheckboxSelectMultiple widget - for example - the message actually makes no sense. It makes no sense because you will have multiple checkboxes which you can independently click on.
In fact, have a textual string referencing the likely output method in the model seems to be a layering violation.
Attached is a patch to put this text in only if there is no help_text provided. Since it will use the overridden help_text, people are free to add back in the initial text if required.
Attachments (1)
Change History (2)
by , 14 years ago
| Attachment: | 0001-Allow-the-help_text-on-related-fields-to-be-overridd.patch added |
|---|
comment:1 by , 14 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
This is #9321.