I have a scenario where I need to preserve the order of the selected items when a model object is changed. Is this possible? Here is the setup...
Say I have a model object that has a many-to-many relationship with another model. This relationship is displayed in the UI via the AutoComboboxSelectMultipleWidget. Basically a standard setup for django-selectables. The problem I have is when a user modifies the many-to-many list I need to keep the order, but it changes.
For example, assume the list of items is: [A, B, C, D].
The user selected [D, A, C] when the object was created, the order is preserved.
Then the user edits the form and adds [B], this should make the list [D, A, C, B].
However, what I get is [A, B, C, D].
Is there a way to change this behavior? Thanks!