django-model-utils
django-model-utils copied to clipboard
question: can FieldTracker be used with ManyToManyField?
The doc doesn't mention ManyToManyField.
I don't know; maybe @treyhunner does? If you try it and find out, submit a PR to update the docs!
@pcompassion I'm pretty sure FieldTracker
does not work with ManyToMany
fields.
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 I don't think it would since reverse foreign key is not a field.
@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 I think that's a great idea. Explicit is better than implicit. 👍
fine with me
Please update the documentation to be explicit. Or better yet support m2m fields, the tracker feels incomplete without it.