Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django, userfriendly way to order objects in filter_horizontal widget in admin

I often use the filter_horizontal attribute for many-to-many relationships which renders a FilteredSelectMultiple widget.

The downside of this widget arises when the user needs to be able to order the objects.

This is not user friendly because the order can only be modified on the change_view of the object itself. Which may live in a complete different area of the admin.

Does anyone have ideas about how this can be improved? Is there a FilterSelectMultipleOrderable widget out there? (I didn't find it yet)

like image 439
Sander van Leeuwen Avatar asked Mar 08 '12 12:03

Sander van Leeuwen


1 Answers

Update!! We made a version which extends the default django widget. https://github.com/fabrique/django-sortedm2m


This seems to do the job: http://pypi.python.org/pypi?:action=display&name=django-sortedm2m

It just renders a list so it could use some styling.

like image 96
Sander van Leeuwen Avatar answered Oct 19 '22 05:10

Sander van Leeuwen