etianen / django-reversion

django-reversion is an extension to the Django web framework that provides version control for model instances.
https://django-reversion.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3.04k stars 489 forks source link

following OnetoOneField #942

Closed gitanupam closed 1 year ago

gitanupam commented 1 year ago

I see that ForeignKeys and ManytoManyFields are followed beautifully and automatically without me having to specify follow. OnetoOneField does not seem to be followed. Are OnetoOneFields handled differently?

(I am using django-reversion-compare and my goal is to show what changed in all fields of my model as well as all fields in OnetoOneField model related to it, across any two versions)

etianen commented 1 year ago

I think OneToOneField is handled identically to ForeignKey. It's a subclass of ForeignKey, so should be handled identically.

However, it will only be included in the version data of the owning model (i.e. the model the OneToOneField is defined on), and not the model at the other end of the relationship.