我已经使用 django-simple-history https://django-simple-history.readthedocs.io/en/2.10.0/index.html实现了对 Django 中对象更改的历史跟踪
我已经提到了history
Model 中的一个字段,我可以使用它来查询对象的历史记录。
history = HistoricalRecords()
我们还在数据库中创建了一个名为 name 的表appname_historicalmodelname
。
我想appname_historicalmodelname
在 django admin 中显示此表,其中我们有按 . 排序的记录列表history_time
。
由于我没有该 History 表的 Model 类,因此我无法使用admin.site.register(HistoricalModelName)
. 如何在 Django 管理站点中显示此表?
- 姜戈:1.11
- 蟒蛇:2.7