django-reversion-compare icon indicating copy to clipboard operation
django-reversion-compare copied to clipboard

Changes to ManyToManyField appear later in subsequent version

Open gitanupam opened this issue 8 years ago • 1 comments
trafficstars

Thanks for this project! Super helpful.

After setting it up for my project and running a few test runs, I noticed that if there is a change in a ManyToManyField, it appears in the subsequent version (and not in that version).

For example:

If the model has 3 fields:

name = models.CharField(max_length=200)
section = models.CharField(max_length=200)
area = models.ManyToManyField(Area, blank=True, db_index=True)

And we make the edits in 4 iterations:

Version 1: original Version 2: name changed Version 3: name and area changed Version 4: section changed

On comparing version 1 and 2, I see the name changed (expected) On comparing version 2 and 3, I see the name changed (unexpected - since area was also changed) On comparing version 3 and 4, I see the section and the area changed (unexpected - since area was actually changed in the previous revision)

This is happening with all ManyToManyFields.

Is this a known issue? (not sure if the issue is with django-reversion or django-reversion-compare)

gitanupam avatar Jun 01 '17 11:06 gitanupam

I also see the following warning at the end of the comparisons: Fields/entries marked with * are not under reversion control. It may be that not all marked information are correct.

It seems * is marked only for ForeignKey fields and ManyToManyFields. If thats the original issue, do I have to do something to make bring those under reversion control as well?

gitanupam avatar Jun 01 '17 11:06 gitanupam