Django应用程序可跟踪跨系统的所有操作/事件。
django-history-actions的Python项目详细描述
#Django历史操作
Django应用程序跟踪跨系统的操作/事件。
[![构建状态](https://travis-ci.org/marcosschroh/django-history-actions.svg?branch=master)(https://travis ci.org/marcosschroh/django history actions)
[![codecov](https://codecov.io/gh/marcosschroh/django history actions/branch/master/graph/badge.svg)(https://codecov.io/gh/marcosschroh/django history actions)
[![Github许可证](https://img.shields.io/github/license/marcosschroh/django history actions.svg)](https://github.com/marcosschroh/django history actions/blob/master/license)
![pypi-pypi-pypython-pypi-python-pypython-pypython-python-python(https://img.shieldeshields.io/badge/python-3-blue.svg)
-[目录表**
-[特征]
-[模型描述]([模型描述]
-[快速启动]([快速启动]
-[系统名称]([系统名称]
-[信号]
-[信号]
-[信号]
-[系统名称]
-[系统名称]
-[系统名称]
-[系统名称]
运行测试](运行测试)
###功能
1.保存Django车型的历史记录。
2.定义全局系统名称或每个模型
3。操作应用程序检查器。
4.跟踪已保存模型的信号。
字段类型必需默认
行动执行str true
系统系统名str true取自设置或模型实例
参与者参与操作的参与者(用户名)str false
创建操作创建日期时间日期时间false自动生成
内容类型内容模型实例str false从模型实例自动生成
object object pk int false从模型实例
notes与操作相关的附加说明textfield false
extra存储可序列化对象的附加字段的类型。| textfield false
quickstart
install django history actions:
`` bash
pip install django history events
`````
将其添加到“已安装的应用程序”中:
`` python
已安装的应用程序=(
…
“历史操作”,
……
定义你的系统名
history动作系统的系统名‘main’
```
>定义你的动作。py在你的应用程序中定义你的动作。py在你的应用程序中
``python
actions.pyy
info.utils.translation从django.utils.translation导入ugettext你的懒惰行为
info/>info-trainiu-trainiu-trainiu-save-action='info-trainiu-trainiu-action/>
操作={
'信息培训保存操作':'info trainig save action')
}
````
“info_training_save_action”)
记录链接到模型的事件
model_instance=modelklass.objects.first()
historymanager.create(
“an_author”,“info_training_save_action”,模型实例=模型实例)
notes='my notes')
extra=model_instace_dict)
ict,system=“custom”)
```
相关的“用户名=”用户管理器“)
给定的“用户名=models.charfield(
'给定的名称',最大长度=200,默认值=”)
系列名称=models.charfield(
'系列名称',最大长度=200,默认值=')
````
系统名称
系统名称取自:
1。“create”方法“kwargs”。
2.来自“settings.py”中定义的“history\u actions”系统变量。
3。在模型类中定义的类变量“history\u action\u system”。
```
Django应用程序跟踪跨系统的操作/事件。
[![构建状态](https://travis-ci.org/marcosschroh/django-history-actions.svg?branch=master)(https://travis ci.org/marcosschroh/django history actions)
[![codecov](https://codecov.io/gh/marcosschroh/django history actions/branch/master/graph/badge.svg)(https://codecov.io/gh/marcosschroh/django history actions)
[![Github许可证](https://img.shields.io/github/license/marcosschroh/django history actions.svg)](https://github.com/marcosschroh/django history actions/blob/master/license)
![pypi-pypi-pypython-pypi-python-pypython-pypython-python-python(https://img.shieldeshields.io/badge/python-3-blue.svg)
-[目录表**
-[特征]
-[模型描述]([模型描述]
-[快速启动]([快速启动]
-[系统名称]([系统名称]
-[信号]
-[信号]
-[信号]
-[系统名称]
-[系统名称]
-[系统名称]
-[系统名称]
运行测试](运行测试)
###功能
1.保存Django车型的历史记录。
2.定义全局系统名称或每个模型
3。操作应用程序检查器。
4.跟踪已保存模型的信号。
字段类型必需默认
行动执行str true
系统系统名str true取自设置或模型实例
参与者参与操作的参与者(用户名)str false
创建操作创建日期时间日期时间false自动生成
内容类型内容模型实例str false从模型实例自动生成
object object pk int false从模型实例
notes与操作相关的附加说明textfield false
extra存储可序列化对象的附加字段的类型。| textfield false
quickstart
install django history actions:
`` bash
pip install django history events
`````
将其添加到“已安装的应用程序”中:
`` python
已安装的应用程序=(
…
“历史操作”,
……
定义你的系统名
history动作系统的系统名‘main’
```
>定义你的动作。py在你的应用程序中定义你的动作。py在你的应用程序中
``python
actions.pyy
info.utils.translation从django.utils.translation导入ugettext你的懒惰行为
info/>info-trainiu-trainiu-trainiu-save-action='info-trainiu-trainiu-action/>
操作={
'信息培训保存操作':'info trainig save action')
}
````
“info_training_save_action”)
记录链接到模型的事件
model_instance=modelklass.objects.first()
historymanager.create(
“an_author”,“info_training_save_action”,模型实例=模型实例)
notes='my notes')
extra=model_instace_dict)
ict,system=“custom”)
```
相关的“用户名=”用户管理器“)
给定的“用户名=models.charfield(
'给定的名称',最大长度=200,默认值=”)
系列名称=models.charfield(
'系列名称',最大长度=200,默认值=')
````
系统名称
系统名称取自:
1。“create”方法“kwargs”。
2.来自“settings.py”中定义的“history\u actions”系统变量。
3。在模型类中定义的类变量“history\u action\u system”。
```