romgar/django-dirtyfields

compare m2m

MiltosD opened this issue · 2 comments

Using v.1.2.1 I'm trying to make a comparison between stored model.m2m.all() (which is a list) and the one about to be saved...

dirty_fields = self.get_dirty_fields( verbose=True, # get list of all referenced 'myField' check_m2m={'myField': set([instance.id for instance in self.myField.all()])})

So if the saved list is set([1,2,3]) and want to delete one set([1,2]), this is not captured. What am I doing wrong?

Hi @MiltosD ! Not sure to fully understand your question. Can you please show a code example to illustrate what is not working as expected?

Closing it because of inactivity. Feel free to open it again @MiltosD if you have some code to show or a more precise description.