django-model-utils icon indicating copy to clipboard operation
django-model-utils copied to clipboard

question: can FieldTracker be used with ManyToManyField?

Open pcompassion opened this issue 9 years ago • 8 comments

The doc doesn't mention ManyToManyField.

pcompassion avatar Mar 10 '15 01:03 pcompassion

I don't know; maybe @treyhunner does? If you try it and find out, submit a PR to update the docs!

carljm avatar Mar 10 '15 16:03 carljm

@pcompassion I'm pretty sure FieldTracker does not work with ManyToMany fields.

treyhunner avatar Mar 11 '15 16:03 treyhunner

Also, you know if it work with reverse ForeignKey @treyhunner ?

class Title(models.Model):
    tracker = FieldTracker(fields=['descriptions'])

class Description(models.Model):
    title = models.ForeignKey(related_name='descriptions')

I checked inside post_save and no fields showed up.

little-gui avatar Jun 17 '16 17:06 little-gui

@little-gui I don't think it would since reverse foreign key is not a field.

treyhunner avatar Jun 18 '16 01:06 treyhunner

@carljm @treyhunner do you think we should update the documentation to detail what is not handled?

It could make sense, as there is not a long list of possible situations.

romgar avatar Nov 27 '16 14:11 romgar

@romgar I think that's a great idea. Explicit is better than implicit. 👍

treyhunner avatar Nov 28 '16 18:11 treyhunner

fine with me

carljm avatar Nov 28 '16 23:11 carljm

Please update the documentation to be explicit. Or better yet support m2m fields, the tracker feels incomplete without it.

gregorypease280 avatar Apr 14 '17 19:04 gregorypease280