[Django] #28993: make many to many picker widget available to user forms

7 views
Skip to first unread message

Django

unread,
Jan 6, 2018, 10:05:47 PM1/6/18
to django-...@googlegroups.com
#28993: make many to many picker widget available to user forms
-------------------------------------+-------------------------------------
Reporter: Rick | Owner: nobody
Graves |
Type: New | Status: new
feature |
Component: Utilities | Version: 1.11
Severity: Normal | Keywords: widget many to many
Triage Stage: | picker
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hello,

This is a request for code reuse.

The many to many picker widget is available via the admin interface, but
I need to put it on a form that users access. I asked on stackoverflow,
but no one has answered.

[https://stackoverflow.com/questions/48040322/django-where-is-the-many-to-
many-picker-widget]

I upload a picture of the widget I have in mind.

Is there a way to reuse the code for this widget?

Thanks,

--
Ticket URL: <https://code.djangoproject.com/ticket/28993>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 6, 2018, 10:06:35 PM1/6/18
to django-...@googlegroups.com
#28993: make many to many picker widget available to user forms
-------------------------------------+-------------------------------------
Reporter: Rick Graves | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: 1.11
Severity: Normal | Resolution:

Keywords: widget many to many | Triage Stage:
picker | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rick Graves):

* Attachment "many_2_many_picker_widget.png" added.

screen shot of the many to many picker widget on the users admin page

Django

unread,
Jan 8, 2018, 4:03:51 AM1/8/18
to django-...@googlegroups.com
#28993: make many to many picker widget available to user forms
-------------------------------------+-------------------------------------
Reporter: Rick Graves | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: 1.11
Severity: Normal | Resolution:

Keywords: widget many to many | Triage Stage:
picker | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Dev Aggarwal):

you can use the widget from
{{{
from django.forms.widgets import SelectMultiple
}}}

The filter_horizontal / filter_vertical widget is accessible from
{{{
from django.contrib.admin.widgets import FilteredSelectMultiple
}}}

Fun Fact- I found this out using pycharm. Tracked the widgets of the
ModelForm using it's Go To Declaration Feature

--
Ticket URL: <https://code.djangoproject.com/ticket/28993#comment:1>

Django

unread,
Jan 8, 2018, 10:13:49 AM1/8/18
to django-...@googlegroups.com
#28993: Make admin's many to many picker widget available in django.forms

-------------------------------------+-------------------------------------
Reporter: Rick Graves | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: 1.11
Severity: Normal | Resolution: wontfix

Keywords: widget many to many | Triage Stage:
picker | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => wontfix
* component: Utilities => Forms


Comment:

`FilteredSelectMultiple` isn't available in `django.forms` because it
relies on jQuery and we want to avoid coupling generally available form
widgets to a specific JavaScript library. You can use the widget as
suggested in the previous comment, but be aware that backwards
compatibility isn't guaranteed.

--
Ticket URL: <https://code.djangoproject.com/ticket/28993#comment:2>

Reply all
Reply to author
Forward
0 new messages