Django Custom Widget For ManyToMany field

2020-03-04 08:36发布

问题:

Does anyone know of a widget that displays 2 select boxes. One shows a list of all object in a model and the other shows the objects which have been selected. The user can then select an object from the first list, click an >> button which moves it to the 'selected' list. Then when the form is saved the objects in the selected list are saved in the manytomany field.

Thanks

回答1:

django.contrib.admin.widgets.FilteredSelectMultiple