2

I have some many2many fields with a lot of options to choose from and I'd like to have two multichoices for each one, on the left the available options and on the right side the chosen ones. Here is an example that Django does with the Groups.

Groups from Django auth app

I have two questions:

  1. How is this kind of "widged" called?
  2. How can I implement it using Django 1.5.1 in an easy way in order to use it in the frontend and in the backend forms? Is there a native option or a 3rd party app?

Thanks!

Caumons
  • 9,341
  • 14
  • 68
  • 82
  • does this help ? http://stackoverflow.com/questions/2216974/django-modelform-for-many-to-many-fields – karthikr May 19 '13 at 14:49
  • @karthikr I think this doesn't help in my case. What I actually need is: Instead of selecting the items directly in the multiple choices widged I'd like to be able to populate the second one clicking the propper arrow. – Caumons May 19 '13 at 15:02

1 Answers1

2

This widget is called FilteredSelectMultiple. It can be used in Django admin through filter_horizontal or filter_vertical property of ModelAdmin class. If you want to implement such a widget yourself, perhaps its source code may be helpful.

KrzysiekJ
  • 186
  • 4
  • Thanks a lot! This is what I was looking for! I already have it working in the admin. For the frontend forms I've found this website http://dashdrum.com/blog/2012/05/using-the-filterselectmultiple-widget/ I'll give it a try! :) – Caumons May 19 '13 at 15:44