History of a ManyToManyField in django-simple-history

后端 未结 1 1010
半阙折子戏
半阙折子戏 2021-01-19 08:46

Story short, I need to save in the history the changes made on a Many-To-Many fields of one of my models.

I can see from: https://github.com/Kyruus/django-simple-his

1条回答
  •  温柔的废话
    2021-01-19 08:50

    This is an old open question, and might be irrelevant by now, but from looking into the code of the project in question, it seems like the last line on the ClassRoom model should be changed to

    history = HistoricalRecords(m2m_fields=['students'])
    

    0 讨论(0)
提交回复
热议问题