#6183 closed (fixed)
[patch] Support help_text with ManyToMany field widgets
Reported by: | 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)
Change History (22)
by , 17 years ago
Attachment: | newforms-admin_ManyToManyField-widget.patch added |
---|
by , 17 years ago
Attachment: | screenshot.png added |
---|
comment:1 by , 17 years ago
Keywords: | nfa-someday added |
---|---|
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 15 years ago
Keywords: | nfa-someday removed |
---|
Newforms-admin merged to trunk long time ago.
Maybe someday is now? :-)
comment:5 by , 15 years ago
Version: | newforms-admin → 1.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 , 15 years ago
Cc: | added |
---|
by , 15 years ago
Attachment: | django-6183-better.patch added |
---|
Much smaller patch, tested in Safari/IE/Firefox/Chrome
comment:7 by , 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 , 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 , 14 years ago
Owner: | changed from | to
---|
follow-up: 11 comment:10 by , 14 years ago
Patch needs improvement: | unset |
---|---|
Version: | 1.1 → 1.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 by , 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 , 14 years ago
Keywords: | sprintSep2010 added |
---|
comment:13 by , 14 years ago
Cc: | added |
---|
comment:15 by , 14 years ago
milestone: | → 1.3 |
---|
Updated patch against current trunk:
https://github.com/acdha/django/compare/django-master...django-6183-1.3
https://github.com/acdha/django/compare/django-master...django-6183-1.3.patch
comment:16 by , 14 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:17 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.