Opened 17 years ago

Closed 14 years ago

Last modified 13 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: no UI/UX: no

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@…> 17 years ago.
screenshot.png (28.6 KB ) - added by Steven Armstrong <sa@…> 17 years ago.
django-6183.patch (2.8 KB ) - added by Chris Adams 15 years ago.
Updated patch for 1.1
django-6183-better.patch (1.1 KB ) - added by Chris Adams 15 years ago.
Much smaller patch, tested in Safari/IE/Firefox/Chrome

Download all attachments as: .zip

Change History (22)

by Steven Armstrong <sa@…>, 17 years ago

by Steven Armstrong <sa@…>, 17 years ago

Attachment: screenshot.png added

comment:1 by Brian Rosner, 17 years ago

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 by kit1980, 15 years ago

Keywords: nfa-someday removed

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

comment:3 by Lakin Wecker, 15 years ago

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

comment:4 by Karen Tracey, 15 years ago

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

by Chris Adams, 15 years ago

Attachment: django-6183.patch added

Updated patch for 1.1

comment:5 by Chris Adams, 15 years ago

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 by Chris Adams, 15 years ago

Cc: chris@… added

by Chris Adams, 15 years ago

Attachment: django-6183-better.patch added

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

comment:7 by Chris Adams, 15 years ago

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 by mattjmorrison, 14 years ago

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 by Chris Adams, 14 years ago

Owner: changed from nobody to Chris Adams

comment:10 by Chris Adams, 14 years ago

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

in reply to:  10 comment:11 by Chris Adams, 14 years ago

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 by Chris Adams, 14 years ago

Keywords: sprintSep2010 added

comment:13 by Andrew Badr, 14 years ago

Cc: andrewbadr.etc@… added

comment:14 by Ramiro Morales, 14 years ago

See also #14402.

comment:16 by Jannis Leidel, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:17 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

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

comment:18 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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