jrief / django-admin-sortable2

Generic drag-and-drop ordering for objects in the Django admin interface
https://django-admin-sortable2.readthedocs.io/en/latest/
Other
753 stars 179 forks source link

reorder command without ordering Meta field #337

Closed jej closed 1 year ago

jej commented 1 year ago

Some models want to order in the admin interface only, and not in Meta. This hacks allows to use an "_ordering_sortable" model attribute to specify the order, so that reorder command can do job anyway. Meta ordering takes the priority. I hope it's a clean approach.

jrief commented 1 year ago

a) I don't understand what this change can achieve, currently not possible with either UpOrderedSortableBookAdmin or DownOrderedSortableBookAdmin. b) apparently you didn't read the Contribution Guidelines.

jej commented 1 year ago

If I am not wrong, reorder with the manage command is not possible if order is not specified in Meta. But that's not mandatory to use Meta for ordering. This PR proposes a way to inform about the order, even when not specified in Meta. I didn't see in doc other way to do that... Maybe just a dirty hack I agree...