Opened 9 years ago

Closed 6 years ago

Last modified 5 years ago

#6183 closed (fixed)

[patch] Support help_text with ManyToMany field widgets

Reported by: Steven Armstrong <sa@…> Owned by: Chris Adams
Component: contrib.admin Version: 1.2
Severity: Keywords: sprintSep2010
Cc: chris@…, andrewbadr.etc@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Currently the help_text for ManyToMany fields is not showed in the admin if you use the nifty filter interfaces.

It is removed while generating the widget in SelectFilter2.js.

The attached patch fixes that by putting the help texts in a place where they don't interfere with the markup of the select filter widget.

Only tested in firefox. I don't have any other browser at hand atm.

Attachments (4)

newforms-admin_ManyToManyField-widget.patch (3.5 KB) - added by Steven Armstrong <sa@…> 9 years ago.
screenshot.png (28.6 KB) - added by Steven Armstrong <sa@…> 9 years ago.
django-6183.patch (2.8 KB) - added by Chris Adams 7 years ago.
Updated patch for 1.1
django-6183-better.patch (1.1 KB) - added by Chris Adams 7 years ago.
Much smaller patch, tested in Safari/IE/Firefox/Chrome

Download all attachments as: .zip

Change History (22)

Changed 9 years ago by Steven Armstrong <sa@…>

Changed 9 years ago by Steven Armstrong <sa@…>

Attachment: screenshot.png added

comment:1 Changed 9 years ago by Brian Rosner

Keywords: nfa-someday added
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

This looks good and pretty trivial to get included. Test your patch on all browsers and patch up anything that breaks. However this isn't critical before merging to trunk. Tagging with nfa-someday.

comment:2 Changed 8 years ago by kit1980

Keywords: nfa-someday removed

Newforms-admin merged to trunk long time ago.
Maybe someday is now? :-)

comment:3 Changed 8 years ago by Lakin Wecker

Yeah I'd be interested in getting this added to trunk too.

comment:4 Changed 7 years ago by Karen Tracey

#11452 and #6459 were closed as dupes of this.

Changed 7 years ago by Chris Adams

Attachment: django-6183.patch added

Updated patch for 1.1

comment:5 Changed 7 years ago by Chris Adams

Version: newforms-admin1.1

The attached patch is updated against 1.1 and changes the mechanics slightly: instead of appending the help_text to the bottom of the widget, it ensures that it will be the first element in the container, which doesn't interfere with the filter widgets.

comment:6 Changed 7 years ago by Chris Adams

Cc: chris@… added

Changed 7 years ago by Chris Adams

Attachment: django-6183-better.patch added

Much smaller patch, tested in Safari/IE/Firefox/Chrome

comment:7 Changed 7 years ago by Chris Adams

I've uploaded a much more concise version of this patch which behaves the same as django-6183.patch and doesn't require the change to related.py. Tested in Safari 4, Firefox 3.5, IE7 (don't have 6 or 8 handy) and Chrome 4. Can someone review the patch?

comment:8 Changed 7 years ago by mattjmorrison

I'm not sure if this is really a separate issue, but it seems related to this one... First off, why is there default help text in the ManyToManyField specific to a widget that COULD be used for that type of field? It seems like that "Hold down control..." wording really doesn't belong in a database level field class at all. Secondly, I'm sure this was added for a reason, but why is the help_text of a ManyToManyField not over-writable? Looking at the trunk, any specified help_text that I specify on my ManyToManyFields still has the "widget specific" wording appended to the end of it. In my case, I'd like to specify some help_text for a ManyToManyField and I also happen to be using my own custom widget for that same field. Since the "Hold down control..." wording doesn't make any sense for my custom widget, I should be able to override it with my own help_text.

IMHO, I think the real patch should remove the default help_text from the ManyToManyField class all together, and have that help_text added to the SelectMultiple widget instead.

Let me know if you think this should be a separate ticket/patch...

comment:9 Changed 6 years ago by Chris Adams

Owner: changed from nobody to Chris Adams

comment:10 Changed 6 years ago by Chris Adams

Patch needs improvement: unset
Version: 1.11.2

I think the larger question of where the help text comes from is definitely worth some changes but it's beyond the scope of this ticket.

Current patch here after testing:
http://github.com/acdha/django/compare/django-bug-6183

comment:11 in reply to:  10 Changed 6 years ago by Chris Adams

Replying to acdha:

I think the larger question of where the help text comes from is definitely worth some changes but it's beyond the scope of this ticket.

Current patch here after testing:
http://github.com/acdha/django/compare/django-bug-6183

Direct patch link: http://github.com/acdha/django/compare/django-bug-6183.patch

comment:12 Changed 6 years ago by Chris Adams

Keywords: sprintSep2010 added

comment:13 Changed 6 years ago by Andrew Badr

Cc: andrewbadr.etc@… added

comment:14 Changed 6 years ago by Ramiro Morales

See also #14402.

comment:16 Changed 6 years ago by Jannis Leidel

Triage Stage: AcceptedReady for checkin

comment:17 Changed 6 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [15150]) Fixed #6183 -- Stopped hiding the help text for SelectFilter widgets. Thanks, acdha.

comment:18 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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