django-sortedm2m icon indicating copy to clipboard operation
django-sortedm2m copied to clipboard

The module recreates the rows of the intermediate table

Open raagin opened this issue 1 year ago • 1 comments

When I save an instance with SortedManyToManyField, rows of the intermediate table with selected values are re-created not updated. Even when no changes are made. Is this required behavior?

raagin avatar Apr 26 '23 11:04 raagin

Saving an instance should never do anything with any related ManyToManyField fields of any sub-types. If we're in the example testapp...

https://github.com/jazzband/django-sortedm2m/blob/master/example/testapp/models.py

Changing the plate field of a Car instance, and calling .save() on that car, for example, shouldn't affect the parking areas it is in (or has a parking permit for, interpretation unclear). It would be helpful if you could clarify what you're saying with some code.

AlanCoding avatar May 09 '23 14:05 AlanCoding