【文件属性】:
文件名称:django-history:django 模型的完整历史记录
文件大小:9KB
文件格式:ZIP
更新时间:2021-06-14 08:45:43
Python
一般描述
用于保存对象更改历史记录的应用程序。 该技术取自 [Pro Django (by Marty Alchin)] [1] 这本书。
该应用程序可以:
保存对对象的所有更改
回滚更改
只需开启,不需要手动创建模型来保存历史,而每个模型的更改历史存储在不同的表中
可以使用pip安装:
pip install -e git + git: //github.com/ildus/django-history.git#egg=django-history
安装:
将 django_history.current_context.CurrentUserMiddleware 添加到中间件
在要保存历史记录的模型中,添加
from django_history.models import HistoricalRecords history = HistoricalRecords()
执行同
【文件预览】:
django-history-master
----README.rst(3KB)
----django_history()
--------models.py(13KB)
--------manager.py(765B)
--------current_context.py(3KB)
--------__init__.py(0B)
----htmlversion.html(4KB)
----setup.py(710B)
----.gitignore(94B)