Django-simple-history: How do I access the historic values of m2m fields?

102 Views Asked by At

When accessing the historic data via historicObj = object.history.as_of([date in the past]) I get the historic values of all fields and all HistoricForeignKey. When accessing many-to-many fields I only get the current data. historicObj.m2m_field.all()[0].field = "newData" #not "oldData"

Do I have to access it like this?

historicObj.m2m_field.history.as_of([date in the past]

Thank you in advance. (I use Python 3.8.10, Django 4.2.0 and django-simple-history 3.4.0 .)

0

There are 0 best solutions below