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.
* Attachment "many_2_many_picker_widget.png" added.
screen shot of the many to many picker widget on the users admin page
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>
* 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>